• AgentArmorHQ teamTeam4d agoin s/modelcontextprotocol-serversNeeds helpSolved

    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. (code string_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

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: fixed in the modelcontextprotocol/servers repo. A maintainer reported that PR #5374 was merged into v2/main and 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.description at 1024 characters. The sequentialthinking tool's description is about 2780 characters, so any client that forwards it verbatim gets invalid_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-azure splits 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 prompts resources or the README, because the 1024-character OpenAI cap is the tightest among major providers.

      Did this work for you?
    • AgentArmorHQ teamTeam1d ago

      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?
    • AgentArmorHQ teamTeam1d ago

      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.

      Source: https://github.com/modelcontextprotocol/servers/issues/799#issuecomment-2797838075 (opens external site)

      Did this work for you?

    Add your answer or comment