sequentialthinking MCP tool description too long for OpenAI (1024-char limit)
I'm using the sequentialthinking MCP server through a client that forwards MCP tool descriptions into tool-enabled completion requests for gpt-4o-mini. The request fails with
Invalid 'tools[26].function.description': string too long. Expected a string with maximum length 1024, but got a string with length 2780 instead.(codestring_above_max_length). Is this a bug in the sequentialthinking server, and what is the workaround for OpenAI and Azure OpenAI models?Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/799
3 answers
Status: fixed in the modelcontextprotocol/servers repo. A maintainer reported that PR #5374 was merged into
v2/mainand ships in v2.3.0. The thread does not describe what the change does, so check the PR or changelog if you need details.The root cause is not in the MCP protocol: the MCP spec sets no description-length limit, but OpenAI and Azure OpenAI cap
tools[].function.descriptionat 1024 characters. The sequentialthinking tool's description is about 2780 characters, so any client that forwards it verbatim getsinvalid_request_error. One commenter confirmed this is an OpenAI-API-wide limit (not just Azure) and noted that Anthropic and Gemini are currently looser.A workaround that worked for one user: the community fork
olafgeibig/sequential-thinking-azuresplits the server into two tool methods. The main thinking tool gets a short description that requires the model to call an instruction tool first, and that instruction tool returns the long usage text. The author reports it works well in their testing, but calls it hacky and says it may not behave the same in every scenario.General advice from another commenter: keep schema descriptions short and move long usage guidance into MCP
promptsresources or the README, because the 1024-character OpenAI cap is the tightest among major providers.Did this work for you?What @jamesfalkner tried on GitHub (Didn't work)
Used a client that forwards MCP tool descriptions to gpt-4o-mini; the request was rejected with invalid_request_error saying the sequentialthinking description length of 2780 exceeds the 1024 maximum.
Source: https://github.com/modelcontextprotocol/servers/issues/799 (opens external site)
Did this work for you?What @olafgeibig tried on GitHub (Worked)
Forked the server (olafgeibig/sequential-thinking-azure) and added a second tool method that returns the lengthy instructions, while shortening the thinking tool's description and requiring the model to call the instruction method first. Reported to work well in testing on Azure OpenAI, with caveats.
Did this work for you?
Related questions
- mcp-server-fetch: 'AnyUrl' object has no attribute 'decode' error
- Does the official MCP Postgres example validate SQL before executing it?
- How to fix UTF-8 Japanese text corruption/crash in mcp-server-sqlite with Claude Desktop on Windows?
- MCP Knowledge Graph Memory Server fails with ${workspaceFolder} in MEMORY_FILE_PATH
- npx @modelcontextprotocol/server-filesystem: ERR_MODULE_NOT_FOUND for zod-to-json-schema