Class ChartWebMcpExecuteEventArgs
Raised on the SfChart component before a WebMCP tool executes. Hosts can audit the call, cancel it, request confirmation, or override the cancellation message.
Inherited Members
Namespace: Syncfusion.Blazor.Charts
Assembly: Syncfusion.Blazor.Charts.dll
Syntax
public class ChartWebMcpExecuteEventArgs
Remarks
The same args type is also passed to the host-level OnWebMcpExecute
event (declared on ChartEvents) when a per-instance
ChartWebMcpTool entry — either a Command="Custom" tool or a
built-in override — is invoked by the agent. In that case the host signals
"I produced a result" by supplying a JSON string in Result.
Built-in overrides that leave Result at null fall
through to the built-in handler so metadata-only overrides
(Name/Description) keep working without a host event handler.
Command="Custom" tools that leave Result at null
cause the dispatcher to return ExecutionFailed.
The dispatcher raises OnWebMcpExecute BEFORE the confirmation
dialog so the host can audit, veto (Cancel),
force or suppress the dialog (ShowConfirmationDialog),
and customize the cancellation message
(CancellationResponse) before the user is prompted.
The event fires for every write tool that reaches the dispatcher,
including built-in catalog tools that the host did not register
through ChartWebMcpTool, so a host that wants to defend against
any built-in tool only needs to bind OnWebMcpExecute — no
per-tool entry is required.
Constructors
ChartWebMcpExecuteEventArgs()
Declaration
public ChartWebMcpExecuteEventArgs()
Properties
Arguments
Gets or sets the agent's arguments as a read-only dictionary of CLR objects.
Declaration
public IReadOnlyDictionary<string, object>? Arguments { get; set; }
Property Value
| Type |
|---|
| IReadOnlyDictionary<string, object> |
Remarks
JSON null values are omitted. A missing key and an explicit JSON null are the
same on this view. Use the raw arguments JSON when the host must tell them apart.
This replaced an earlier dictionary of JsonElement values.
Cancel
Gets or sets a value indicating whether the host has cancelled the operation.
Declaration
public bool Cancel { get; set; }
Property Value
| Type |
|---|
| bool |
Remarks
Set to true by the host to cancel the operation entirely.
CancellationResponse
Gets or sets the optional custom message used in the [USER_CANCELLED] response.
Declaration
public string? CancellationResponse { get; set; }
Property Value
| Type |
|---|
| string |
Remarks
Used in two cases: when the host sets
Cancel to true inside the pre-dialog event,
and when the user denies the confirmation dialog. When null,
the dispatcher falls back to a default [USER_CANCELLED]
sentinel so the agent can still recognise the cancellation.
Command
Gets or sets the built-in operation this invocation maps to.
Declaration
public ChartWebMcpToolCommand Command { get; set; }
Property Value
| Type |
|---|
| ChartWebMcpToolCommand |
Remarks
Populated by the dispatcher from the static catalog via
WebMcpAdapter.ResolveCommandForBaseName; falls back to
Custom for host-registered
custom tools whose Name is not a catalog enum member.
The host can read but does not need to set this value.
Name
Gets or sets the bare catalog name the dispatcher is about to execute.
Declaration
public string? Name { get; set; }
Property Value
| Type |
|---|
| string |
Remarks
For Custom tools this is the tool's Name; for built-ins it is the
catalog enum member name (such as inspectChart, exportChart).
Result
Gets or sets the JSON string the host event handler produced for the agent.
Declaration
public string? Result { get; set; }
Property Value
| Type |
|---|
| string |
Remarks
Required for Custom tools (otherwise the dispatcher returns
ExecutionFailed). For built-in overrides the dispatcher falls
through to the built-in handler when this value is null, so
a metadata-only override can still register without supplying a result.
The dispatcher's "I handled this" test is Result is not null.
ShowConfirmationDialog
Gets or sets a value indicating whether the host requires a confirmation dialog.
Declaration
public bool ShowConfirmationDialog { get; set; }
Property Value
| Type |
|---|
| bool |
Remarks
The dispatcher seeds this property from the catalog's
requiresConfirmation flag before raising the host event.
Inside OnWebMcpExecute the host can flip
it to force a dialog for a tool that the catalog marks as safe, or
suppress the dialog for a tool the host has already approved out of
band (set it to false before returning).
Read tools never reach the confirmation gate by design, except a
custom tool: the host can set this to true and the dispatcher
shows the dialog before returning Result.