Google Sheets Integration for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Google Sheets MCP or direct API to create spreadsheets, update rows, analyze data, and automate reporting through natural language.
Google Sheets Logo
Gradient Top
Gradient Middle
Gradient Bottom
divider

Supported Tools and Triggers

Tools
Triggers
Add Sheet to SpreadsheetAdds a new sheet (worksheet) to a spreadsheet.
Aggregate Column DataSearches for rows where a specific column matches a value and performs mathematical operations on data from another column.
Append DimensionTool to append new rows or columns to a sheet, increasing its size.
Batch get spreadsheetRetrieves data from specified cell ranges in a google spreadsheet; ensure the spreadsheet has at least one worksheet and any explicitly referenced sheet names in ranges exist.
Batch update spreadsheetUpdates a specified range in a google sheet with given values, or appends them as new rows if `first cell location` is omitted; ensure the target sheet exists and the spreadsheet contains at least one worksheet.
Batch Update Values by Data FilterTool to update values in ranges matching data filters.
Clear Basic FilterTool to clear the basic filter from a sheet.
Clear spreadsheet valuesClears cell content (preserving formatting and notes) from a specified a1 notation range in a google spreadsheet; the range must correspond to an existing sheet and cells.
Create Chart in Google SheetsCreate a chart in a google sheets spreadsheet using the specified data range and chart type.
Create a Google SheetCreates a new google spreadsheet in google drive using the provided title.
Create spreadsheet columnCreates a new column in a google spreadsheet, requiring a valid `spreadsheet id` and an existing `sheet id`; an out-of-bounds `insert index` may append/prepend the column.
Create spreadsheet rowInserts a new, empty row into a specified sheet of a google spreadsheet at a given index, optionally inheriting formatting from the row above.
Delete Dimension (Rows/Columns)Tool to delete specified rows or columns from a sheet in a google spreadsheet.
Delete SheetTool to delete a sheet (worksheet) from a spreadsheet.
Execute SQL on SpreadsheetExecute sql queries against google sheets tables.
Find worksheet by titleFinds a worksheet by its exact, case-sensitive title within a google spreadsheet; returns a boolean indicating if found and the complete metadata of the entire spreadsheet, regardless of whether the target worksheet is found.
Format cellApplies text and background cell formatting to a specified range in a google sheets worksheet.
Get sheet namesLists all worksheet names from a specified google spreadsheet (which must exist), useful for discovering sheets before further operations.
Get Spreadsheet by Data FilterReturns the spreadsheet at the given id, filtered by the specified data filters.
Get spreadsheet infoRetrieves comprehensive metadata for a google spreadsheet using its id, excluding cell data.
Get Table SchemaThis action is used to get the schema of a table in a google spreadsheet, call this action to get the schema of a table in a spreadsheet before you query the table.
Insert Dimension in Google SheetTool to insert new rows or columns into a sheet at a specified location.
List Tables in SpreadsheetThis action is used to list all tables in a google spreadsheet, call this action to get the list of tables in a spreadsheet.
Look up spreadsheet rowFinds the first row in a google spreadsheet where a cell's entire content exactly matches the query string, searching within a specified a1 notation range or the first sheet by default.
Query Spreadsheet TableThis action is used to query a table in a google spreadsheet, call this action to query a table in a spreadsheet.
Search Developer MetadataTool to search for developer metadata in a spreadsheet.
Search SpreadsheetsSearch for google spreadsheets using various filters including name, content, date ranges, and more.
Set Basic FilterTool to set a basic filter on a sheet in a google spreadsheet.
Create sheet from JSONCreates a new google spreadsheet and populates its first worksheet from `sheet json`, which must be non-empty as its first item's keys establish the headers.
Copy Sheet to Another SpreadsheetTool to copy a single sheet from a spreadsheet to another spreadsheet.
Append Values to SpreadsheetTool to append values to a spreadsheet.
Batch Clear Spreadsheet ValuesTool to clear one or more ranges of values from a spreadsheet.
Batch Clear Values By Data FilterClears one or more ranges of values from a spreadsheet using data filters.
Batch Get Spreadsheet Values by Data FilterTool to return one or more ranges of values from a spreadsheet that match the specified data filters.
Update Sheet PropertiesTool to update properties of a sheet (worksheet) within a google spreadsheet, such as its title, index, visibility, tab color, or grid properties.
Update Spreadsheet PropertiesTool to update properties of a spreadsheet, such as its title, locale, or auto-recalculation settings.

Connect Google Sheets MCP Tool with your Agent

Python
TypeScript

Install Composio

python
pip install composio claude-agent-sdk
Install the Composio SDK and Claude Agent SDK

Create Tool Router Session

python
from composio import Composio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

composio = Composio(api_key='your-composio-api-key')
session = composio.create(user_id='your-user-id')
url = session.mcp.url
Initialize the Composio client and create a Tool Router session

Connect to AI Agent

python
import asyncio

options = ClaudeAgentOptions(
    permission_mode='bypassPermissions',
    mcp_servers={
        'tool_router': {
            'type': 'http',
            'url': url,
            'headers': {
                'x-api-key': 'your-composio-api-key'
            }
        }
    },
    system_prompt='You are a helpful assistant with access to Google Sheets tools.',
    max_turns=10
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query('Add a new sheet named "Q2 Analysis" to the spreadsheet called "Financial Report 2024"')
        async for message in client.receive_response():
            if hasattr(message, 'content'):
                for block in message.content:
                    if hasattr(block, 'text'):
                        print(block.text)

asyncio.run(main())
Use the MCP server with your AI agent

Connect Google Sheets API Tool with your Agent

Python
TypeScript

Install Composio

python
pip install composio_openai
Install the Composio SDK

Initialize Composio and Create Tool Router Session

python
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
openai = OpenAI()
session = composio.create(user_id='your-user-id')
Import and initialize Composio client, then create a Tool Router session

Execute Google Sheets Tools via Tool Router with Your Agent

python
tools = session.tools
response = openai.responses.create(
  model='gpt-4.1',
  tools=tools,
  input=[{
    'role': 'user',
    'content': 'Add a new sheet called "Q2 Results" to my sales spreadsheet'
  }]
)
result = composio.provider.handle_tool_calls(
  response=response,
  user_id='your-user-id'
)
print(result)
Get tools from Tool Router session and execute Google Sheets actions with your Agent

Why Use Composio?

AI Native Google Sheets Integration

  • Supports both Google Sheets MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Google Sheets data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Google Sheets access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Google Sheets
  • Scoped, least privilege access to Google Sheets resources
  • Full audit trail of agent actions to support review and compliance

Frequently Asked Questions

Do I need my own developer credentials to use Google Sheets with Composio?

No, you can get started immediately using Composio's built-in Google Sheets app. For production, we recommend configuring your own OAuth credentials.

Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Used by agents from

Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.