Clarifying tool name rules for MCP and OpenAI APIs

Hi.

It seems that the tool name specification differs between the MCP spec(draft/server/tools#tool-names) and the OpenAI API validation (‘^[a-zA-Z0-9_-]+$’).

For example, MCP enforces a length limit while OpenAI does not, and MCP allows dots (.) whereas OpenAI doesn’t. I’m curious whether this difference is intentional or not.

It might also be helpful to clarify the expected tool name specification in the official documentation.

What do you think?

Regards,

3 Likes

I came here because an MCP server with a tool name that had 66 characters was rejected by the openAI API:

Invalid 'tools[16].name': string too long. Expected a string with maximum length 64, but got a string with length 66 instead.

Yet the MCP Spec says 128 characters max: Tools - Model Context Protocol

It doesn’t seem like this is documented somewhere?

1 Like