Skip to content

Added tabId to missing tools#53

Merged
a-bonus merged 1 commit intoa-bonus:mainfrom
davidthor:bugfix/39
Feb 12, 2026
Merged

Added tabId to missing tools#53
a-bonus merged 1 commit intoa-bonus:mainfrom
davidthor:bugfix/39

Conversation

@davidthor
Copy link
Copy Markdown
Contributor

@davidthor davidthor commented Feb 12, 2026

Here's a summary of everything that was changed.

Core Helper Functions (googleDocsApiHelpers.ts)

  • findTextRange() -- Added optional tabId parameter. When provided, fetches with includeTabsContent: true, locates the target tab via findTabById(), and searches that tab's documentTab.body.content instead of the default document.body.content. Throws a UserError if the tab is not found.
  • getParagraphRange() -- Same pattern as findTextRange(). Now accepts optional tabId and searches within the correct tab's content.
  • createTable() -- Added optional tabId parameter, sets it on the location object when provided.
  • insertInlineImage() -- Added optional tabId parameter, sets it on the location object when provided.

Tool Parameter Schemas (types.ts)

  • ApplyTextStyleToolParameters -- Added optional tabId field.
  • ApplyParagraphStyleToolParameters -- Added optional tabId field.

Tool Implementations

  • applyTextStyle -- Threads tabId to both findTextRange() and buildUpdateTextStyleRequest().
  • applyParagraphStyle -- Threads tabId to findTextRange(), getParagraphRange(), and buildUpdateParagraphStyleRequest().
  • insertTable -- Added tabId parameter with tab existence verification, passes through to createTable().
  • insertPageBreak -- Added tabId parameter with tab existence verification, sets it on the location object.
  • insertImage -- Added tabId parameter with tab existence verification, passes through to insertInlineImage().

Tests (googleDocsApiHelpers.test.ts)

  • findTextRange with tabId correctly searches tab-specific content
  • findTextRange throws UserError for nonexistent tabId
  • findTextRange without tabId does not use includeTabsContent
  • getParagraphRange with tabId correctly searches tab-specific content
  • getParagraphRange throws UserError for nonexistent tabId

Fixes #39, #11, and #34

@a-bonus a-bonus merged commit 17353ac into a-bonus:main Feb 12, 2026
2 checks passed
@davidthor davidthor deleted the bugfix/39 branch February 12, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add tabId parameter to applyParagraphStyle and applyTextStyle

2 participants