Skip to content

Remove maxLength from MCP tool JSON schemas#114

Merged
nathanjcochran merged 1 commit intomainfrom
nathan/fix-mcp-tool-schemas
Nov 20, 2025
Merged

Remove maxLength from MCP tool JSON schemas#114
nathanjcochran merged 1 commit intomainfrom
nathan/fix-mcp-tool-schemas

Conversation

@nathanjcochran
Copy link
Member

Some models/providers don't support the maxLength JSON Schema config option for limit string length (such as Sonnet 4.5 when run through Vertex, as when using Google Antigravity). This can cause the MCP server to completely break the AI agent.

This fixes the problem by simply removing the maxLength config. We were using it to limit the length of service names (to match the back-end validation), but it's probably unlikely that users will hit the length limit often anyways, and if they do, they'll just get an error from the backend that explains the problem, and the LLM can retry:

> Create a new database service with a very long name (200 characters at least)

⏺ tiger - Create Database Service (MCP)(name: "this-is-a-very-long-database-service-name-that-exceeds-the-typical-length-limits-for-testing-purposes-and-to-see-how-the-system-handles-extrem
                                       ely-long-names-with-many-characters-in-them-which-should-be-at-least-two-hundred-characters-long-to-meet-the-requirement")
  ⎿  Error: service name cannot be longer than 128 characters

⏺ The system doesn't allow service names longer than 128 characters. The maximum length is 128 characters.

  Would you like me to create a service with a 128-character name instead (the maximum allowed)?

@nathanjcochran nathanjcochran self-assigned this Nov 20, 2025
@nathanjcochran nathanjcochran merged commit e121283 into main Nov 20, 2025
2 checks passed
@nathanjcochran nathanjcochran deleted the nathan/fix-mcp-tool-schemas branch November 20, 2025 17:31
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