Invalid 'tools[11].function.description': string too long

Issue Description

I’ve just started using MCP servers and now, when I’m using gpt-4o via AzureOpenAI, I keep getting the error message below regardless of how many servers are running. This error does not happen with claude 3.5 sonnet

Error Message

{
  "error": {
    "message": "Invalid 'tools[11].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[11].function.description",
    "code": "string_above_max_length"
  }
}

Additional Info

What is particularly curious is that even though the number of tools changes when I add or remove MCP servers, the total string length in the error message remains the same: “2780”

Important Improvement

Allow the developer to enable and disable MCP servers as needed

Hey, my guess is one server you are running has a description that is too long for gpt-4o to correctly use.

You should be able to track down whichever server is causing this by trial and error for now, but we are hoping to add more features around MCP servers to make errors like this easier to diagnose in the future!