WebMcpToolExecuteEventArgs

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

Props

The following table outlines the props for the WebMcpToolExecuteEventArgs:

NameTypeDefaultDescription
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.

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 name of the WebMCP tool being executed (e.g. 'createEvent', 'changeView').