From 2d332f12f0486259fe18072540afd5b149ba5606 Mon Sep 17 00:00:00 2001 From: Henry Park Date: Thu, 5 Mar 2026 19:20:29 -0800 Subject: [PATCH] feat(tools): add Google Discovery API URLs to WASM tool descriptions (#585) Add Google Discovery Service URLs to all 6 Google WASM tool descriptions so the LLM can fetch full API documentation on demand using its built-in HTTP tool. Discovery API is public and requires no authentication. URLs added: - Gmail: googleapis.com/discovery/v1/apis/gmail/v1/rest - Calendar: calendar-json.googleapis.com/$discovery/rest?version=v3 - Drive: googleapis.com/discovery/v1/apis/drive/v3/rest - Docs: googleapis.com/discovery/v1/apis/docs/v1/rest - Sheets: googleapis.com/discovery/v1/apis/sheets/v4/rest - Slides: googleapis.com/discovery/v1/apis/slides/v1/rest [skip-regression-check] Co-authored-by: Claude Opus 4.6 (1M context) --- tools-src/gmail/src/lib.rs | 4 +++- tools-src/google-calendar/src/lib.rs | 4 +++- tools-src/google-docs/src/lib.rs | 4 +++- tools-src/google-drive/src/lib.rs | 4 +++- tools-src/google-sheets/src/lib.rs | 4 +++- tools-src/google-slides/src/lib.rs | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tools-src/gmail/src/lib.rs b/tools-src/gmail/src/lib.rs index 221fd072..c0f45008 100644 --- a/tools-src/gmail/src/lib.rs +++ b/tools-src/gmail/src/lib.rs @@ -110,7 +110,9 @@ impl exports::near::agent::tool::Guest for GmailTool { fn description() -> String { "Gmail integration for reading, searching, sending, drafting, and replying to emails. \ Supports Gmail search query syntax (is:unread, from:, subject:, after:, etc.). \ - Requires a Google OAuth token with gmail.modify and gmail.compose scopes." + Requires a Google OAuth token with gmail.modify and gmail.compose scopes. \ + To discover all available API operations, use http GET to fetch \ + (public, no auth needed)." .to_string() } } diff --git a/tools-src/google-calendar/src/lib.rs b/tools-src/google-calendar/src/lib.rs index 9cfd8ca3..814c5b84 100644 --- a/tools-src/google-calendar/src/lib.rs +++ b/tools-src/google-calendar/src/lib.rs @@ -129,7 +129,9 @@ impl exports::near::agent::tool::Guest for GoogleCalendarTool { fn description() -> String { "Google Calendar integration for viewing, creating, updating, and deleting calendar \ events. Requires a Google Calendar OAuth token with the calendar.events scope. \ - Supports timed events, all-day events, attendees, locations, and free text search." + Supports timed events, all-day events, attendees, locations, and free text search. \ + To discover all available API operations, use http GET to fetch \ + (public, no auth needed)." .to_string() } } diff --git a/tools-src/google-docs/src/lib.rs b/tools-src/google-docs/src/lib.rs index 3b2176d0..fe625ef0 100644 --- a/tools-src/google-docs/src/lib.rs +++ b/tools-src/google-docs/src/lib.rs @@ -199,7 +199,9 @@ impl exports::near::agent::tool::Guest for GoogleDocsTool { bulleted/numbered lists. Also provides a batch_update action for complex multi-step \ edits executed atomically. Document IDs are the same as Google Drive file IDs, so use \ the google-drive tool to search for existing documents. Requires a Google OAuth token \ - with the documents scope." + with the documents scope. \ + To discover all available API operations, use http GET to fetch \ + (public, no auth needed)." .to_string() } } diff --git a/tools-src/google-drive/src/lib.rs b/tools-src/google-drive/src/lib.rs index 0bed57d2..87363cd9 100644 --- a/tools-src/google-drive/src/lib.rs +++ b/tools-src/google-drive/src/lib.rs @@ -160,7 +160,9 @@ impl exports::near::agent::tool::Guest for GoogleDriveTool { files and folders. Supports personal drives and shared (organizational) drives via the \ corpora parameter. Can search with Drive query syntax, download text files, upload new \ files, manage folder structure, and control sharing permissions. Requires a Google OAuth \ - token with the drive scope." + token with the drive scope. \ + To discover all available API operations, use http GET to fetch \ + (public, no auth needed)." .to_string() } } diff --git a/tools-src/google-sheets/src/lib.rs b/tools-src/google-sheets/src/lib.rs index f7d7687f..b83c0b73 100644 --- a/tools-src/google-sheets/src/lib.rs +++ b/tools-src/google-sheets/src/lib.rs @@ -174,7 +174,9 @@ impl exports::near::agent::tool::Guest for GoogleSheetsTool { (tab) management (add, delete, rename), and cell formatting (bold, colors, alignment, \ number formats). Spreadsheet IDs are the same as Google Drive file IDs, so use the \ google-drive tool to search for existing spreadsheets. Requires a Google OAuth token \ - with the spreadsheets scope." + with the spreadsheets scope. \ + To discover all available API operations, use http GET to fetch \ + (public, no auth needed)." .to_string() } } diff --git a/tools-src/google-slides/src/lib.rs b/tools-src/google-slides/src/lib.rs index 170958bf..eb818562 100644 --- a/tools-src/google-slides/src/lib.rs +++ b/tools-src/google-slides/src/lib.rs @@ -209,7 +209,9 @@ impl exports::near::agent::tool::Guest for GoogleSlidesTool { Also provides a batch_update action for complex multi-step edits executed atomically. \ Positions and sizes use points (standard slide is 720x405 pt). Presentation IDs are the \ same as Google Drive file IDs, so use the google-drive tool to search for existing \ - presentations. Requires a Google OAuth token with the presentations scope." + presentations. Requires a Google OAuth token with the presentations scope. \ + To discover all available API operations, use http GET to fetch \ + (public, no auth needed)." .to_string() } }