Class WebMcpToolExecuteEventArgs
Provides information about a WebMCP tool execution request.
Inherited Members
Namespace: Syncfusion.Blazor.PivotView
Assembly: Syncfusion.Blazor.PivotView.dll
Syntax
public class WebMcpToolExecuteEventArgs
Remarks
An instance of this class is provided to the OnWebMcpExecute event whenever a WebMCP tool is invoked through a SfPivotView<TValue> instance.
The properties of this class describe the requested tool and its input arguments. Use this information to inspect, audit, validate, or cancel tool execution before the corresponding handler runs.
For custom tools, the host application is responsible for handling the invocation and returning a response by assigning a value to Result.
For built-in tools, the pivot table executes the associated built-in handler unless execution is cancelled or a custom response is provided.
Exceptions thrown during event handling are converted into structured execution-failed responses and returned to the requesting agent.
Constructors
WebMcpToolExecuteEventArgs()
Declaration
public WebMcpToolExecuteEventArgs()
Properties
Arguments
Gets or sets the input arguments supplied with the tool execution request.
Declaration
public IReadOnlyDictionary<string, object>? Arguments { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, object> | An IReadOnlyDictionary<TKey, TValue> containing the argument names and values provided for the current tool invocation, or null if the tool does not define or receive any input arguments. |
Remarks
The collection is intended for reading request data. Assigning a new value to this property does not modify the arguments used by the built-in tool execution logic. To override the default behavior of a built-in tool, assign a value to Result during the OnWebMcpExecute event.
Cancel
Gets or sets a value indicating whether the tool execution should be cancelled.
Declaration
public bool Cancel { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | A bool indicating whether execution is cancelled. true cancels the operation; otherwise, false. The default value is false. |
Remarks
When execution is cancelled, the dispatcher returns a cancellation response to the requesting agent instead of invoking the associated tool handler.
Command
Gets the command associated with the tool execution request.
Declaration
public PivotViewWebMcpToolCommand Command { get; }
Property Value
| Type | Description |
|---|---|
| PivotViewWebMcpToolCommand | A PivotViewWebMcpToolCommand identifying the built-in command or Custom for a custom tool. |
Remarks
For built-in tools, this value is the exact enum member associated with the command, such as ApplySorting. Custom tools use Custom. This property is set by the pivot table and cannot be changed by application code.
Result
Gets or sets the custom response payload produced by the host's OnWebMcpExecute event handler, returned to the AI agent in place of the built-in handler's output.
Declaration
public object? Result { get; set; }
Property Value
| Type | Description |
|---|---|
| object | An object representing the custom result data, or null when no custom response is supplied by the host. The default value is null. |
Remarks
Assigning a value to this property suppresses the normal tool execution pipeline and returns the supplied value directly to the requesting agent. If both Cancel and Result are set, Cancel takes precedence.
ToolName
Gets the name of the tool being executed.
Declaration
public string? ToolName { get; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the tool associated with the current WebMCP execution request, or null if no tool name is available. |
Remarks
For custom tools, this value corresponds to the configured Name. For built-in tools, this value corresponds to the effective tool name exposed to the agent after any customization applied through PivotViewWebMcpTool.