Skip to content

fix: resolve API errors in getDocumentInfo and applyParagraphStyle#25

Merged
a-bonus merged 1 commit intoa-bonus:mainfrom
ratsch:fix/api-errors
Nov 29, 2025
Merged

fix: resolve API errors in getDocumentInfo and applyParagraphStyle#25
a-bonus merged 1 commit intoa-bonus:mainfrom
ratsch:fix/api-errors

Conversation

@ratsch
Copy link
Copy Markdown
Contributor

@ratsch ratsch commented Nov 29, 2025

Summary

Fixes critical API errors that prevented getDocumentInfo and applyParagraphStyle tools from working correctly with Google Docs files.

Changes

getDocumentInfo

  • Fixed: Remove permissions and alternateLink fields from Drive API request
  • Reason: These fields cause "Invalid field selection" errors for Google Docs files
  • Impact: Tool now reliably returns document metadata without errors

applyParagraphStyle

  • Fixed: Change alignment enum from LEFT/RIGHT to START/END

  • Reason: Google Docs API requires START/END per internationalization standards

    • START = left for LTR languages, right for RTL languages
    • END = right for LTR languages, left for RTL languages
  • Impact: Prevents "Invalid value for ParagraphStyle.alignment" errors

  • Simplified: Remove redundant applyToContainingParagraph field from target parameter

  • Reason: Field was always true and served no purpose

  • Impact: Cleaner parameter schema, same functionality

Testing

  • ✅ Built successfully with TypeScript
  • ✅ Verified getDocumentInfo returns metadata without errors
  • ✅ Verified applyParagraphStyle accepts START/END alignment values
  • ✅ No linter errors

Breaking Changes

⚠️ Minor: Users of applyParagraphStyle must use START/END instead of LEFT/RIGHT for alignment. Note that the old values caused API errors anyway, so this is effectively a bug fix rather than a breaking change.

- getDocumentInfo: Remove 'permissions' and 'alternateLink' fields that cause
  'Invalid field selection' errors for Google Docs files
- applyParagraphStyle: Fix alignment enum to use START/END instead of LEFT/RIGHT
  per Google Docs API internationalization requirements
- applyParagraphStyle: Simplify target parameter by removing redundant
  applyToContainingParagraph field (was always true)
@a-bonus a-bonus merged commit 95bfad7 into a-bonus:main Nov 29, 2025
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.

2 participants