workforms: trim MCP tool descriptions by ~79% to reduce token cost#321
Merged
Eliasgarzon merged 7 commits intoApr 26, 2026
Merged
Conversation
Reduce token cost of the 4 workforms MCP tools from ~4,591 tokens/request
to ~1,740 tokens/request (~62% reduction, ~2,851 tokens saved per request).
Decision criteria: pragmatic-prompting Principle of Unambiguity — only
describe what is non-obvious from the field name, type, or enum values.
What was cut:
- All "Object containing X configuration" container descriptions (redundant
with the object's own fields)
- Boolean/string descriptions that restate the field name verbatim
- Verbose multi-line action list in update_form (13 actions already visible
in the enum schema)
- URL-extraction tutorial in get_form (pattern is clear from the one-liner)
What was kept:
- Non-obvious constraints: passwordEnabled can only be set to false
- PUT-semantics warning on selectOptions (replaces all existing options)
- "Must include all existing IDs" constraint on question reordering
- Action-specific requirements ("Required for updateFormHeader")
- Type-qualifier prefixes on settings ("MultiSelect only", "Date only")
Also fixed: replaced semicolons with commas in showIfRules description
to pass tool-description-safety tests (MCP clients forbid semicolons
in tool descriptions as potential injection vectors).
Monday: https://monday.monday.com/boards/3709356818/pulses/11453478027
Co-Authored-By: Claude <noreply@anthropic.com>
…ching options/settings Agents were sending PATCH updates without type and getting schema validation failures. 'Update is patch' implied all fields optional, but the backend requires type to validate type-specific field shapes (options, settings). Unambiguity fix: state explicitly what is NOT implied by patch semantics.
…itionally Schema analysis: type has no .optional() in questionSchema, so it is structurally required for both create and update operations. Previous description 'also required if options/settings are included' understated the constraint and caused agents to omit type on plain patch updates.
…hema files Empty-string .describe() calls produce no output in MCP schema (zod-to-json-schema skips falsy values) but still cost maintenance burden. Removed all 64 empty entries from workforms.consts.ts and the corresponding .describe() call-sites in update-form-tool/schema.ts and form-questions-editor-tool/schema.ts.
GuyHadas
approved these changes
Apr 26, 2026
RomKadria
approved these changes
Apr 26, 2026
Collaborator
|
update version in apckage json |
…cost (v5.3.3)
- Removed descriptions restating field names, types, or enum values
- Removed all container object descriptions ("Object containing X configuration")
- Rewrote remaining descriptions to be terse and actionable
- Added non-obvious constraints: type immutability on update, safe option
update workflow (call get_form first), page_block_id null vs omit distinction,
existing_column_id usage guidance
- update_form action description now explains each action requires different fields
- Net result: ~4,591 -> ~963 tokens per request across all 4 form tools
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…xtraction example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
What Was Cut
"Object containing X configuration""Boolean hiding monday branding from the form display."hideBranding: booleanis self-explanatoryupdate_formactionenum valuesget_formWhat Was Kept
passwordEnabledcan only be set tofalse; usesetFormPasswordto enableselectOptions: omitting an existing option deletes it — fetch first to update safelyupdateFormHeader"Token Counts (Before → After, description text only)
get_formcreate_formform_questions_editorupdate_form