feat(forms): Add batch_update_form tool for Google Forms API - #390
Conversation
Add batch_update_form MCP tool that exposes the Google Forms batchUpdate API endpoint. Supports createItem, updateItem, deleteItem, moveItem, updateFormInfo, and updateSettings operations. Includes _batch_update_form_impl internal function for testability and 6 unit tests covering multiple requests, single request, empty replies, missing replies key, URL generation, and mixed reply types. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Thanks for the PR! You're missing the tool tiers entry and README docs, but seems like useful capability. |
Add batch_update_form to the Complete tier in tool_tiers.yaml and document it in both README files as requested in PR review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Thanks for the review! This is Arno (Ugo's AI assistant) — I've added the tool tiers entry and README docs in b7a2f08. Let me know if anything else needs updating. |
There was a problem hiding this comment.
Pull request overview
This PR adds batch update functionality to the Google Forms module by introducing a new batch_update_form tool that wraps the Google Forms API batchUpdate endpoint, enabling programmatic modification of form content after creation.
Changes:
- Added
batch_update_formtool with internal_batch_update_form_implfunction for testability - Created comprehensive unit test suite with 6 test cases covering various batch update scenarios
- Updated documentation to reflect the new tool availability
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
gforms/forms_tools.py |
Implements _batch_update_form_impl and batch_update_form tool supporting all Forms API batch update request types |
tests/gforms/test_forms_tools.py |
Adds 6 unit tests covering multiple requests, single requests, empty/missing replies, URL generation, and mixed reply types |
core/tool_tiers.yaml |
Registers batch_update_form in the "complete" tier for forms |
README_NEW.md |
Updates tool count from 5 to 6 and adds batch_update_form to the forms tools table |
README.md |
Adds batch_update_form entry to the forms tools table |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "createItem": { | ||
| "item": { | ||
| "title": "Favourite colour?", |
There was a problem hiding this comment.
Corrected spelling of 'Favourite' to 'Favorite' to match American English spelling convention.
| "title": "Favourite colour?", | |
| "title": "Favorite color?", |
…into feature/forms-batch-update
Summary
batch_update_formMCP tool exposing the Google FormsbatchUpdateAPI endpointcreateItem,updateItem,deleteItem,moveItem,updateFormInfo,updateSettings_batch_update_form_implinternal function for testability (matching existing_implpattern from Apps Script tools)pytest+pytest-asyncio+MockconventionsMotivation
The Forms module has
create_formandget_formbut no way to modify form content after creation. The Google Forms API supportsbatchUpdatenatively — this PR exposes it through the MCP server, enabling users to programmatically add questions, update settings, and manage form structure.Changes
gforms/forms_tools.py_batch_update_form_impl+batch_update_form(+95 lines)tests/gforms/__init__.pytests/gforms/test_forms_tools.pyDesign Decisions
_implpattern for testability — separates business logic from MCP decorators, matchinggappsscript/apps_script_tools.pyTest Plan
pytest tests/gforms/test_forms_tools.py -v)ruff checkpasses with no issues@server.tool()→@handle_http_errors→@require_google_service