sequentialthinking tool description beyond OpenAI length limitation
Describe the bug The length of the description of the sequentialthinking server is longer than the max allowed length of tool descriptions when using some OpenAI models.
To Reproduce Steps to reproduce the behavior:
- Pass the description of the sequentialthinking tool as part of a tool-enabled inference request to
gpt4o-mini.
Expected behavior No errors, and the LLM is able to use the sequentialthinking tool
Logs
In my case, I am using a client to send the completion requests, and that client uses the tool descriptions provided via the MCP server protocol to format the completion requests. When using sequentialthinking tool with gpt40-mini, due to the length of its description, errors happen such as:
- body: {
"error": {
"message": "Invalid 'tools[26].function.description': string too long. Expected a string with maximum length 1024, but got a string with length 2780 instead.",
"type": "invalid_request_error",
"param": "tools[26].function.description",
"code": "string_above_max_length"
}
}
I cannot find any official documentation of this limitation.
Were you trying to use the sequential-thinking MCP server with Azure OpenAI? Because my error message looked exactly like yours. Unfortunately, Azure OpenAI has a 1024 characters limit for tool descriptions. You can find a lot of problem reports about that on the net. So I copied the original code and introduced a workaround.
https://github.com/olafgeibig/sequential-thinking-azure
My workaround introduces a second tool method that returns the lengthy description and shortens the description of teh actual thinking tool method. In the description of the thinking method, it is required to call the instruction method first. This is kind of a hacky workaround, but in my testing it works well. This is the reason why I did not create a PR against the OG repo. My version is significantly different and may not work in certain scenarios.
@jamesfalkner this is most probably not a bug in your code. This is an actual limitation of Azure OpenAI
Long tool descriptions are a widespread problem. We built mcp-checkup which flags tools with excessively long descriptions and counts their token cost. Helps MCP server authors catch these issues during development. npx mcp-checkup
Schema length issues like this are catchable before shipping with automated linting. I built mcpeval which flags tool descriptions over 500 chars and shows you token-by-token budget breakdown per tool. Would have caught this before it hit OpenAI's limit.
mcpeval check server.json
# Shows per-tool token usage + warns on oversized descriptions
The 1024-char ceiling is OpenAI-API-wide, not just Azure — gpt-4o-mini and gpt-4o both enforce it on the tools[].function.description field, and Azure inherits the same backend. The 2780 → 1024 delta on sequentialthinking is the highest-profile case but the pattern repeats across other reference servers (anywhere a tool tries to load a few paragraphs of usage guidance into the description field).
Two framings that have helped on similar issues:
-
Move the long-form rationale out of the JSON Schema
descriptionand into an MCPpromptsresource or the server's README. The schema description should be the model's at-a-glance disambiguator (one sentence, scope + anti-purpose) — anything longer is asking the model to re-read a manual on every turn anyway, and most clients won't render it. The protocol gives youpromptsprecisely for the "here's how to use this server well" content. -
Treat description length as a portability constraint, not a stylistic one. OpenAI's 1024 cap is the tightest of the major providers (Anthropic + Gemini are looser today but no one has documented their actual ceilings publicly). Servers that ship cross-provider need to fit the smallest box.
A per-tool budget worth keeping in mind: name ~30 chars + description ≤900 chars + per-parameter description ~150 chars. That fits comfortably under every published limit and still leaves room for the anti-purpose sentence that drives correct selection.
Triage: Priority Low (total 4)
- Severity 2: The sequentialthinking tool description is still about 2,780 characters, well over the 1,024-character cap that OpenAI and Azure OpenAI APIs enforce on tool descriptions, so clients forwarding it to those models get a request error; the MCP spec sets no such limit, so this is a portability improvement rather than a protocol defect.
- Urgency 2: wanted eventually
- Bonuses: none
Still present on v2 (checked by reading the current code).
Board: Servers V2 (#43), Status Incoming, awaiting maintainer review (no milestone yet). Part of the backlog triage in #4875.
Prior work, from the PR backlog triage (#4877). These outside pull requests addressed this issue against the pre-refactor code:
- #4177 by @pntech20
They are being closed as part of the backlog triage in #4875, since the repository now takes issues rather than outside PRs and their diffs predate the v2 refactor. They stay readable and serve as prototypes for the fix here. Thank you to their authors.
Fixed by #5374, merged into v2/main. Ships in v2.3.0.