Diagram - WebMcpToolExecuteEventArgs

30 Sep 20261 minute to read

Defines the event arguments for the beforeWebMcpToolExecute event.
Provides access to the tool name and its input arguments before execution,
and allows the application to inspect, modify, or cancel the operation.

Properties

cancel boolean

Specifies whether the tool execution should be cancelled.
Set to true to prevent the tool from executing.

cancellationResponse string

Specifies a custom response message to send back to the AI when tool execution is cancelled,
either by setting cancel to true or when the user dismisses the confirmation dialog.
When not provided, a default cancellation message is sent to the AI.

registeredName string

Specifies the name the tool was registered under on document.modelContext, including any
prefix applied by registerWebMcpTools (e.g. 'myApp_deleteFromDiagram').

showConfirmationDialog boolean

Set to true to display a confirmation dialog to the user before the tool executes.
Execution proceeds only if the user confirms.

toolArgs object

Specifies the arguments passed to the tool.
The shape of this object matches the tool’s inputSchema as defined in the tool registry.

toolName string

Specifies the base name of the WebMCP tool being executed
(e.g. 'createDiagramNode', 'deleteFromDiagram').
This value never includes the prefix applied during registration, so a comparison such as
args.toolName === 'deleteFromDiagram' works regardless of how the tools were registered.