Skip to content

feat(mcp): pass operation description, x-platforms and enums to tools - #49

Merged
Gintm merged 2 commits into
developfrom
feat-mcp-richer-tool-descriptions
Oct 5, 2026
Merged

Gintm merged 2 commits into
developfrom
feat-mcp-richer-tool-descriptions

Conversation

@Gintm

@Gintm Gintm commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Why

MCP tool descriptions carried only the OpenAPI summary, so agents never saw an operation's constraints, its supported platforms, or a parameter's allowed values. A customer's agent called the Google-only ad_campaigns_get_campaign_targeting with platform=linkedin and got a 501.

What

  • Tool description = summary + operation description (capped at 1000 chars, escaped) + Platforms: ... from x-platforms.
  • String enums (scalars and array items) become Literal types: the tool schema lists the allowed values and FastMCP rejects others before the API call.
  • generated_tools.py regenerated from the current spec: 942 tools, descriptions 233K → 581K chars total (max +1.1K per tool), 388 enum params across 227 tools, no parameter description changed.
  • Tests for description, platforms, escaping, the cap and enum rejection.

Follow-ups

  • 59 tools already leak their whole Args: section into the description (FastMCP can't parse it, e.g. create_standalone_ad at 55K chars). Pre-existing, unchanged here.

🤖 Generated with Claude Code

Gintm and others added 2 commits October 5, 2026 13:27
Tool descriptions carried only the OpenAPI summary, so an agent picking a
tool never saw "Google only; every other platform returns 501", the
supported platforms, or a parameter's allowed values. A customer's agent
called the Google-only campaign targeting tool with platform=linkedin.

- Tool description = summary + operation description (capped at 1000
  chars, escaped) + "Platforms: ..." from x-platforms.
- String enums become Literal types: the schema lists the allowed values
  and FastMCP rejects others before the API call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator passes headers= as a keyword, so the stub must keep the name.
Broke ruff on develop since #48; the Tests workflow had not run there since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gintm
Gintm merged commit 8856a5a into develop Oct 5, 2026
4 checks passed
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.

1 participant