From 6835f7aa2850c7226b897e25c0fec48ce398e764 Mon Sep 17 00:00:00 2001 From: DavidMulder0 Date: Mon, 23 Mar 2026 09:07:51 +0000 Subject: [PATCH 1/5] Codify MCP tool name requirements and add title --- index.bs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.bs b/index.bs index e602129..7e9ee8b 100644 --- a/index.bs +++ b/index.bs @@ -118,6 +118,14 @@ A tool definition is a [=struct=] with the following [=struct/items=] :: a [=string=] uniquely identifying a tool registered within a [=model context=]'s [=model context/tool map=]; it is the same as the [=map/key=] identifying this object. + The [=tool definition/name=] SHOULD: + * Be between 1 and 128 characters in length (inclusive). + * Be considered case-sensitive. + * Only consist of uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.). + + : title + :: A [=string=] representing a human-readable title of the tool to be used in the user interface to represent the tool. + : description :: a [=string=]. From 843d9cb2f8b8c3e11087319a3c9fe86de7598937 Mon Sep 17 00:00:00 2001 From: DavidMulder0 Date: Mon, 23 Mar 2026 15:02:55 +0000 Subject: [PATCH 2/5] Update index.bs Co-authored-by: Dominic Farolino --- index.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 7e9ee8b..990a8b4 100644 --- a/index.bs +++ b/index.bs @@ -124,7 +124,8 @@ A tool definition is a [=struct=] with the following [=struct/items=] * Only consist of uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.). : title - :: A [=string=] representing a human-readable title of the tool to be used in the user interface to represent the tool. + :: A [=string=] representing a human-readable title of the tool to be used in the user interface + to represent the tool. : description :: a [=string=]. From b63a48ecd389d80ba5c9f7bb47fca352f1f812f2 Mon Sep 17 00:00:00 2001 From: "David Mulder (dmr9)" Date: Mon, 23 Mar 2026 15:47:17 +0000 Subject: [PATCH 3/5] Codify MCP tool name requirements and add title --- index.bs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 990a8b4..8c2378e 100644 --- a/index.bs +++ b/index.bs @@ -119,13 +119,13 @@ A tool definition is a [=struct=] with the following [=struct/items=] context/tool map=]; it is the same as the [=map/key=] identifying this object. The [=tool definition/name=] SHOULD: - * Be between 1 and 128 characters in length (inclusive). + * Have a [=string/length=] between 1 and 128, inclusive. * Be considered case-sensitive. - * Only consist of uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.). + * Only consist of [=ASCII alphanumeric=] [=code points=], U+005F LOW LINE (_), U+002D HYPHEN-MINUS (-), and U+002E FULL STOP (.). : title :: A [=string=] representing a human-readable title of the tool to be used in the user interface - to represent the tool. + to represent the tool. : description :: a [=string=]. @@ -215,12 +215,18 @@ The registerTool(tool) method step 1. Let |tool name| be |tool|'s {{ModelContextTool/name}}. +1. Let |tool title| be |tool|'s {{ModelContextTool/title}}. + 1. If |tool map|[|tool name|] [=map/exists=], then [=exception/throw=] an {{InvalidStateError}} {{DOMException}}. -1. If either |tool name| or {{ModelContextTool/description}} is the empty string, then +1. If |tool name|, |tool title| or {{ModelContextTool/description}} is an empty string, then [=exception/throw=] an {{InvalidStateError}} {{DOMException}}. +1. If |tool name|'s [=string/length=] is greater than 128, or if |tool name| contains a + [=code point=] that is not an [=ASCII alphanumeric=], U+005F (_), U+002D (-), or U+002E (.), + then [=exception/throw=] an {{InvalidStateError}}. + 1. Let |stringified input schema| be the empty string. 1. If |tool|'s {{ModelContextTool/inputSchema}} [=map/exists=], then set |stringified input schema| @@ -249,6 +255,9 @@ The registerTool(tool) method step : [=tool definition/name=] :: |tool name| + : [=tool definition/title=] + :: |tool title| + : [=tool definition/description=] :: |tool|'s {{ModelContextTool/description}} @@ -284,6 +293,7 @@ The {{ModelContextTool}} dictionary describes a tool that can be invoked by [=ag dictionary ModelContextTool { required DOMString name; + required DOMString title; required DOMString description; object inputSchema; required ToolExecuteCallback execute; @@ -303,6 +313,11 @@ callback ToolExecuteCallback = Promise<any> (object input, ModelContextClient cl <p>A unique identifier for the tool. This is used by [=agents=] to reference the tool when making tool calls. </dd> + <dt><code><var ignore>tool</var>["{{ModelContextTool/title}}"]</code></dt> + <dd> + <p>A label for the tool. This is used by the user agent to reference the tool in the user interface. + </dd> + <dt><code><var ignore>tool</var>["{{ModelContextTool/description}}"]</code></dt> <dd> <p>A natural language description of the tool's functionality. This helps [=agents=] understand when and how to use the tool. From 297f15c8c251d631986b137328286e044e009c37 Mon Sep 17 00:00:00 2001 From: "David Mulder (dmr9)" <dmr9@3ds.com> Date: Thu, 26 Mar 2026 12:08:06 +0000 Subject: [PATCH 4/5] Make title optional --- index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 8c2378e..5f46ad0 100644 --- a/index.bs +++ b/index.bs @@ -125,7 +125,7 @@ A <dfn>tool definition</dfn> is a [=struct=] with the following [=struct/items=] : <dfn>title</dfn> :: A [=string=] representing a human-readable title of the tool to be used in the user interface - to represent the tool. + to represent the tool. If not provided, the [=tool definition/name=] is used as the default display value. : <dfn>description</dfn> :: a [=string=]. @@ -220,7 +220,7 @@ The <dfn method for=ModelContext>registerTool(<var>tool</var>)</dfn> method step 1. If |tool map|[|tool name|] [=map/exists=], then [=exception/throw=] an {{InvalidStateError}} {{DOMException}}. -1. If |tool name|, |tool title| or {{ModelContextTool/description}} is an empty string, then +1. If |tool name| or {{ModelContextTool/description}} is an empty string, then [=exception/throw=] an {{InvalidStateError}} {{DOMException}}. 1. If |tool name|'s [=string/length=] is greater than 128, or if |tool name| contains a @@ -293,7 +293,7 @@ The {{ModelContextTool}} dictionary describes a tool that can be invoked by [=ag <xmp class="idl"> dictionary ModelContextTool { required DOMString name; - required DOMString title; + DOMString title; required DOMString description; object inputSchema; required ToolExecuteCallback execute; From d7254babe0f35214876bf8313f4d41b3e91e8900 Mon Sep 17 00:00:00 2001 From: "David Mulder (dmr9)" <dmr9@3ds.com> Date: Thu, 26 Mar 2026 12:18:44 +0000 Subject: [PATCH 5/5] Add note to title that it should be localized to the user's language #153 --- index.bs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.bs b/index.bs index 5f46ad0..7bfa960 100644 --- a/index.bs +++ b/index.bs @@ -316,6 +316,8 @@ callback ToolExecuteCallback = Promise<any> (object input, ModelContextClient cl <dt><code><var ignore>tool</var>["{{ModelContextTool/title}}"]</code></dt> <dd> <p>A label for the tool. This is used by the user agent to reference the tool in the user interface. + <p>It is recommended that this string be localized to the user's +{{NavigatorLanguage/language}}. </dd> <dt><code><var ignore>tool</var>["{{ModelContextTool/description}}"]</code></dt>