Add native Google Sheets tools to repo agent#1481
Merged
Merged
Conversation
…d service account New sheets_* tool family (create_spreadsheet, update_values, batch_update_values, get_values, add_sheet) implemented directly against the Google Sheets + Drive REST APIs — no MCP server or googleapis dependency; auth is a service-account JWT flow via the existing jsonwebtoken package, with the access token cached per agent run. Registration mirrors the stakwork tools: credentials arrive on the request body (googleSheets.serviceAccount + optional driveFolderId), are never LLM-visible, and are not persisted to session config. toolsConfig can disable individual tools or override descriptions. Spreadsheets are created through the Drive API inside driveFolderId (shared folder or shared drive) so agent-created sheets are visible to humans; tool descriptions steer the agent toward live USER_ENTERED formulas read back with sheets_get_values render options. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a native
sheets_*tool family torepo/agentso agents can create Google Spreadsheets, build calculations with live formulas, and read computed results back:sheets_create_spreadsheet— creates via the Drive API inside the configured folder/shared drive (supportsAllDrives), so agent-created sheets are immediately visible to humans; supports extra tabs up frontsheets_update_values/sheets_batch_update_values—USER_ENTEREDwrites, so strings starting with=become live formulassheets_get_values—render: computed | formatted | formulafor reading results or auditing formulassheets_add_sheet— add a tab to an existing spreadsheetHow it's triggered
Mirrors the
stakworktools pattern: the family registers only when the caller supplies service-account credentials on the request body — never an LLM-visible parameter, never persisted to session config:{ "prompt": "build a mortgage comparison sheet with live formulas", "googleSheets": { "serviceAccount": { ...service account JSON (object, JSON string, or base64)... }, "driveFolderId": "<shared folder or shared drive id>" } }toolsConfigcan disable individual tools ("sheets_add_sheet": false) or override descriptions, same as everywhere else.Implementation notes
jsonwebtoken, exchanged attoken_uri), then straight REST calls with axios. Access token cached per agent run only, so different callers' credentials never mix.\nin private keys."...failed: ..."strings to the agent.Testing
test:nodesuite passes (181 tests)A1=2, A2=3, A3==A1+A2, and read back the computed5🤖 Generated with Claude Code