From 1b1eb60ec48442494e617d7dffafb3270b5126af Mon Sep 17 00:00:00 2001 From: Alex Hancock Date: Fri, 3 Oct 2025 11:53:49 -0400 Subject: [PATCH] spec/docs: specify tool name format SEP-986 Co-authored-by: Kent C. Dodds --- docs/docs/develop/build-client.mdx | 4 ++++ docs/docs/develop/build-server.mdx | 1 + docs/specification/draft/server/tools.mdx | 13 +++++++++++++ 3 files changed, 18 insertions(+) diff --git a/docs/docs/develop/build-client.mdx b/docs/docs/develop/build-client.mdx index fe0a86433..77c208c28 100644 --- a/docs/docs/develop/build-client.mdx +++ b/docs/docs/develop/build-client.mdx @@ -392,6 +392,10 @@ When you submit a query: - Validate server responses - Be cautious with tool permissions +4. **Tool Names** + - Tool names can be validated according to the format specified [here](/specification/draft/server/tools#tool-names) + - If a tool name conforms to the specified format, it should not fail validation by an MCP client + ## Troubleshooting ### Server Path Issues diff --git a/docs/docs/develop/build-server.mdx b/docs/docs/develop/build-server.mdx index 80e4e5072..36d0d9d8b 100644 --- a/docs/docs/develop/build-server.mdx +++ b/docs/docs/develop/build-server.mdx @@ -59,6 +59,7 @@ Writing to stdout will corrupt the JSON-RPC messages and break your server. ### Best Practices 1. Use a logging library that writes to stderr or files. +1. Tool names should follow the format specified [here](/specification/draft/server/tools#tool-names). ### Quick Examples diff --git a/docs/specification/draft/server/tools.mdx b/docs/specification/draft/server/tools.mdx index 91328bc18..dec65c781 100644 --- a/docs/specification/draft/server/tools.mdx +++ b/docs/specification/draft/server/tools.mdx @@ -204,6 +204,19 @@ tool annotations to be untrusted unless they come from trusted servers. +#### Tool Names + +- Tool names SHOULD be between 1 and 128 characters in length (inclusive). +- Tool names SHOULD be considered case-sensitive. +- The following SHOULD be the only allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits + (0-9), underscore (\_), dash (-), and dot (.) +- Tool names SHOULD NOT contain spaces, commas, or other special characters. +- Tool names SHOULD be unique within a server. +- Example valid tool names: + - getUser + - DATA_EXPORT_v2 + - admin.tools.list + ### Tool Result Tool results may contain [**structured**](#structured-content) or **unstructured** content.