Google Sheets
Lets an agent list, create, and edit spreadsheets in a Google Drive account you connect.
What it can do
| Method | What it does |
|---|---|
list_spreadsheets | List Google Sheets in Drive; name_contains optional, page_token for next page. |
create_spreadsheet | Create a new spreadsheet; returns spreadsheet_id and URL. |
add_sheet | Add a new tab to a spreadsheet by spreadsheet_id. |
list_sheets | List tabs in a spreadsheet: sheet_id, title, index, grid size. |
get_values | Read cell values by A1 range. |
update_values | Write values to a range (overwrites the target cells). |
Write a whole file into a sheet
update_values takes small data inline as values, or a CSV, TSV, JSONL or
JSON file as dataset_input: the whole file is written to the range in one
request (in chunks of 50 rows).
{
"spreadsheet_id": "1AbC...",
"range": "Sheet1!A1",
"dataset_input": {"source": {"agent_file_id": 1234}}
}
format is auto by default (read from the file); set csv, tsv, jsonl or
json when the file name does not say.
- In an agent run the agent passes the
agent_file_idof a file it can use in that run: a file it made, a file attached to the agent, or (for a lead) a file its subagents made. Nothing else is needed. - From the API (
POST /api/v1/agents/custom-tools/call/withtool,actionandarguments), any file of your own account works by itsagent_file_idalone: noexecution_idis needed. Addexecution_idonly to run the call inside that run; it then sees that run's files. - A file of another account is never found, whichever way you call.
How to get credentials
Google OAuth - no token to copy.
- Start the setup in FlyMyAI; enter the Google email you want to use.
- On the Google consent screen, sign in with that account.
- Approve the requested scopes (
spreadsheets,drive.readonly). - You land back in FlyMyAI; the tool flips to Configured.
Fields to fill in FlyMyAI
| FlyMyAI field | Where it comes from |
|---|---|
USER_GOOGLE_EMAIL | The Google account whose Sheets the agent should access |
Troubleshooting
403on a specific sheet - the account doesn't have edit access. Share the sheet with that account, then retry.- Empty result from
list_spreadsheets- the filter didn't match. Try withoutname_contains. - File not found by
agent_file_id- the id must be a file of your own account; withexecution_id, it must also be a file of that run (see above).
Links
We love our partners - FlyMy.AI builds with the best. Thanks, Google Sheets!