From 40cb396890b98dc53839d1c0d47c7dc997d2e801 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Mon, 22 Jun 2026 14:46:23 +1000 Subject: [PATCH 1/5] TINYDOC-3540: Document tinymceai_tool_data_callback option for TinyMCE AI --- modules/ROOT/pages/8.7.0-release-notes.adoc | 13 ++++++ .../configuration/tinymceai_options.adoc | 43 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/modules/ROOT/pages/8.7.0-release-notes.adoc b/modules/ROOT/pages/8.7.0-release-notes.adoc index 60a84540ef..3f6d9eee2c 100644 --- a/modules/ROOT/pages/8.7.0-release-notes.adoc +++ b/modules/ROOT/pages/8.7.0-release-notes.adoc @@ -39,6 +39,19 @@ The following premium plugin updates were released alongside {productname} {rele // For information on the **** plugin, see: xref:.adoc[]. +=== TinyMCE AI + +The {productname} {release-version} release includes an accompanying release of the **TinyMCE AI** premium plugin. + +**TinyMCE AI** includes the following addition. + +==== New `tinymceai_tool_data_callback` option to customize the Model Context Protocol (MCP) tool status message +// #TINYMCE-14474 + +The **TinyMCE AI** plugin now supports the xref:tinymceai.adoc#tinymceai_tool_data_callback[`+tinymceai_tool_data_callback+`] option. This function runs when an MCP server sends an `+mcp-tool-result+` or `+mcp-tool-notification+` event during a streaming response, and returns the status message shown in the Chat sidebar while the AI model calls an MCP tool. + +For information on the **TinyMCE AI** plugin, see: xref:tinymceai.adoc[TinyMCE AI]. + [[improvements]] == Improvements diff --git a/modules/ROOT/partials/configuration/tinymceai_options.adoc b/modules/ROOT/partials/configuration/tinymceai_options.adoc index fb0b72ba71..2e065d29f4 100644 --- a/modules/ROOT/partials/configuration/tinymceai_options.adoc +++ b/modules/ROOT/partials/configuration/tinymceai_options.adoc @@ -276,6 +276,49 @@ tinymce.init({ }); ---- +[[tinymceai_tool_data_callback]] +=== `+tinymceai_tool_data_callback+` + +Customizes the status message shown in the Chat sidebar while the AI model calls a Model Context Protocol (MCP) tool. The function runs when the MCP server sends an `+mcp-tool-result+` or `+mcp-tool-notification+` event during a streaming response. The function returns a string to display as the status message, or returns `+undefined+` to fall back to the default status message. + +*Type:* `+Function+` (`+(event: MCPToolEvent) => string | undefined+`) + +*Default value:* `+undefined+` + +The function receives a single `+event+` argument, which is one of the following objects: + +* An `+mcp-tool-result+` event, sent when a tool returns a result: +** `+type+`: `+'mcp-tool-result'+` +** `+toolName+` (`+String+`): The name of the tool that ran. +** `+result+` (`+String+`): The result the tool returns. +** `+success+` (`+Boolean+`): Whether the tool call succeeded. +* An `+mcp-tool-notification+` event, sent when a tool reports progress or a log message: +** `+type+`: `+'mcp-tool-notification'+` +** `+toolName+` (`+String+`): The name of the tool that sent the notification. +** `+level+` (`+String+`): The severity of the notification. One of `+'error'+`, `+'info'+`, `+'debug'+`, `+'notice'+`, `+'warning'+`, `+'critical'+`, `+'alert'+`, or `+'emergency'+`. +** `+data+`: The data included with the notification. + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_tool_data_callback: (event) => { + if (event.type === 'mcp-tool-result') { + return `Tool ${event.toolName}: ${event.success ? 'completed' : 'failed'}`; + } + // Use the default status message for other events + return undefined; + }, + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + [[options-quickactions]] == Options for Quick Actions From 839655d738aa69edea7d99e62c9949e55d9fe2e0 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Mon, 22 Jun 2026 16:43:50 +1000 Subject: [PATCH 2/5] TINYDOC-3540: Add tool-name mapping example for tinymceai_tool_data_callback --- .../ROOT/partials/configuration/tinymceai_options.adoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/tinymceai_options.adoc b/modules/ROOT/partials/configuration/tinymceai_options.adoc index 2e065d29f4..1f2c65db88 100644 --- a/modules/ROOT/partials/configuration/tinymceai_options.adoc +++ b/modules/ROOT/partials/configuration/tinymceai_options.adoc @@ -298,6 +298,8 @@ The function receives a single `+event+` argument, which is one of the following ** `+level+` (`+String+`): The severity of the notification. One of `+'error'+`, `+'info'+`, `+'debug'+`, `+'notice'+`, `+'warning'+`, `+'critical'+`, `+'alert'+`, or `+'emergency'+`. ** `+data+`: The data included with the notification. +A common use is to map each tool name to a human-readable message. For example, the callback can display `+Accessing Atlassian resources...+` while the `+atlassian-getAccessibleAtlassianResources+` tool runs. + .Example [source,js] ---- @@ -306,8 +308,12 @@ tinymce.init({ plugins: 'tinymceai', toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', tinymceai_tool_data_callback: (event) => { + // Map tool names to human-readable status messages + const statusMessages = { + 'atlassian-getAccessibleAtlassianResources': 'Accessing Atlassian resources...' + }; if (event.type === 'mcp-tool-result') { - return `Tool ${event.toolName}: ${event.success ? 'completed' : 'failed'}`; + return statusMessages[event.toolName] || `Running ${event.toolName}...`; } // Use the default status message for other events return undefined; From 627522612ea0692db224226b5d6f0e6607ccb6da Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Mon, 22 Jun 2026 16:46:50 +1000 Subject: [PATCH 3/5] TINYDOC-3540: Use a generic tool example for tinymceai_tool_data_callback --- modules/ROOT/partials/configuration/tinymceai_options.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ROOT/partials/configuration/tinymceai_options.adoc b/modules/ROOT/partials/configuration/tinymceai_options.adoc index 1f2c65db88..1e7eeafd5c 100644 --- a/modules/ROOT/partials/configuration/tinymceai_options.adoc +++ b/modules/ROOT/partials/configuration/tinymceai_options.adoc @@ -298,7 +298,7 @@ The function receives a single `+event+` argument, which is one of the following ** `+level+` (`+String+`): The severity of the notification. One of `+'error'+`, `+'info'+`, `+'debug'+`, `+'notice'+`, `+'warning'+`, `+'critical'+`, `+'alert'+`, or `+'emergency'+`. ** `+data+`: The data included with the notification. -A common use is to map each tool name to a human-readable message. For example, the callback can display `+Accessing Atlassian resources...+` while the `+atlassian-getAccessibleAtlassianResources+` tool runs. +A common use is to map each tool name to a human-readable message. For example, the callback can display `+Searching the knowledge base...+` while a `+search-knowledge-base+` tool runs. .Example [source,js] @@ -310,7 +310,7 @@ tinymce.init({ tinymceai_tool_data_callback: (event) => { // Map tool names to human-readable status messages const statusMessages = { - 'atlassian-getAccessibleAtlassianResources': 'Accessing Atlassian resources...' + 'search-knowledge-base': 'Searching the knowledge base...' }; if (event.type === 'mcp-tool-result') { return statusMessages[event.toolName] || `Running ${event.toolName}...`; From cab482db962ebcdfc2c5186172dcfa179f19e6e9 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 24 Jun 2026 16:08:39 +1000 Subject: [PATCH 4/5] Update modules/ROOT/pages/8.7.0-release-notes.adoc Co-authored-by: Hamza Benkhaldoun --- modules/ROOT/pages/8.7.0-release-notes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/8.7.0-release-notes.adoc b/modules/ROOT/pages/8.7.0-release-notes.adoc index 3f6d9eee2c..bcacd9089b 100644 --- a/modules/ROOT/pages/8.7.0-release-notes.adoc +++ b/modules/ROOT/pages/8.7.0-release-notes.adoc @@ -48,7 +48,7 @@ The {productname} {release-version} release includes an accompanying release of ==== New `tinymceai_tool_data_callback` option to customize the Model Context Protocol (MCP) tool status message // #TINYMCE-14474 -The **TinyMCE AI** plugin now supports the xref:tinymceai.adoc#tinymceai_tool_data_callback[`+tinymceai_tool_data_callback+`] option. This function runs when an MCP server sends an `+mcp-tool-result+` or `+mcp-tool-notification+` event during a streaming response, and returns the status message shown in the Chat sidebar while the AI model calls an MCP tool. +The **TinyMCE AI** plugin now supports the xref:tinymceai.adoc#tinymceai_tool_data_callback[`+tinymceai_tool_data_callback+`] option. This function runs when an MCP server sends an `+mcp-tool-result+` or `+mcp-tool-notification+` event during a streaming response. The function should return a string that would be displayed as the status message shown in the Chat sidebar while the AI model calls an MCP tool. For information on the **TinyMCE AI** plugin, see: xref:tinymceai.adoc[TinyMCE AI]. From d685e9059c466bb64771c32919f9d3dbee60dcea Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 24 Jun 2026 16:11:58 +1000 Subject: [PATCH 5/5] TINYDOC-3540: Clarify tinymceai_tool_data_callback release note heading Reword the heading to reflect that the option customizes the status message shown while an MCP tool runs, aligning with the body text and the tinymceai_options.adoc reference. --- modules/ROOT/pages/8.7.0-release-notes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/8.7.0-release-notes.adoc b/modules/ROOT/pages/8.7.0-release-notes.adoc index bcacd9089b..f1f0ad5618 100644 --- a/modules/ROOT/pages/8.7.0-release-notes.adoc +++ b/modules/ROOT/pages/8.7.0-release-notes.adoc @@ -45,7 +45,7 @@ The {productname} {release-version} release includes an accompanying release of **TinyMCE AI** includes the following addition. -==== New `tinymceai_tool_data_callback` option to customize the Model Context Protocol (MCP) tool status message +==== New `tinymceai_tool_data_callback` option to customize the status message shown while a Model Context Protocol (MCP) tool runs // #TINYMCE-14474 The **TinyMCE AI** plugin now supports the xref:tinymceai.adoc#tinymceai_tool_data_callback[`+tinymceai_tool_data_callback+`] option. This function runs when an MCP server sends an `+mcp-tool-result+` or `+mcp-tool-notification+` event during a streaming response. The function should return a string that would be displayed as the status message shown in the Chat sidebar while the AI model calls an MCP tool.