alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class PdfViewerWebMcpExecuteEventArgs

    Event payload for the single component-level OnWebMcpExecute event. The host can read the tool name and arguments, cancel the operation, request confirmation for a write tool, override the default cancellation message, and short-circuit the built-in handler (or implement a custom tool) by setting Result to a serialized JSON string.

    Inheritance
    object
    EventArgs
    PdfViewerWebMcpExecuteEventArgs
    Inherited Members
    EventArgs.Empty
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.SfPdfViewer
    Assembly: Syncfusion.Blazor.SfPdfViewer.dll
    Syntax
    public class PdfViewerWebMcpExecuteEventArgs : EventArgs
    Remarks

    The dispatcher fires OnWebMcpExecute exactly once per tool call, after the catalog lookup and before the built-in handler runs. Cancel is checked first; if true, Result is ignored and the agent receives the [USER_CANCELLED] sentinel. ShowConfirmationDialog triggers the confirmation gate (which surfaces the Syncfusion NotificationDialog) for write tools; read tools ignore it. Result short-circuits the built-in handler when non-null and non-empty; null/empty falls through to the built-in handler.

    Inherits from EventArgs directly because the project does not define a ComponentEventBaseArgs base type (unlike the Grid reference). This keeps the WebMCP surface decoupled from the component's existing event-arg hierarchy.

    Constructors

    PdfViewerWebMcpExecuteEventArgs()

    Declaration
    public PdfViewerWebMcpExecuteEventArgs()

    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 arguments exposed through this property correspond to the values supplied by the requesting agent and are typically based on the tool's registered input schema.

    Applications can use this property within the OnWebMcpExecute event to inspect, validate, and process the arguments associated with the current tool request.

    The collection is exposed as an IReadOnlyDictionary<TKey, TValue> and is intended for reading request data.

    Assigning a new value to this property does not modify the arguments used by the pdf viewer's built-in tool execution logic.

    For custom tools, applications can use the supplied argument values when generating a response through Result.

    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

    Set this property to true within the OnWebMcpExecute event to prevent the requested tool from executing.

    When execution is cancelled, the dispatcher returns a cancellation response to the requesting agent instead of invoking the associated tool handler.

    CancellationResponse

    Gets or sets the optional response message returned when execution is cancelled.

    Declaration
    public string? CancellationResponse { get; set; }
    Property Value
    Type Description
    string

    A custom cancellation message, or null to use the default cancellation response.

    Remarks

    This value is used when Cancel is true. The default response includes the [USER_CANCELLED] sentinel.

    Command

    Gets the command associated with the tool execution request.

    Declaration
    public PdfViewerWebMcpToolCommand Command { get; }
    Property Value
    Type Description
    PdfViewerWebMcpToolCommand

    A PdfViewerWebMcpToolCommand 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 GetAnnotations. Custom tools use Custom. This property is set by the pdf viewer and cannot be changed by application code.

    Name

    Gets the name of the tool being executed.

    Declaration
    public string Name { 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 PdfViewerWebMcpTool.

    Applications can use this property within the OnWebMcpExecute event handler to identify the requested tool and provide an appropriate response.

    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 string? Result { get; set; }
    Property Value
    Type Description
    string

    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.

    This property is commonly used when implementing custom WebMCP tools through the OnWebMcpExecute event.

    For built-in tools, setting this property overrides the result that would otherwise be produced by the pdf viewer's built-in tool handler.

    If both Cancel and Result are set, Cancel takes precedence. The supplied result is ignored, and a cancellation response is returned to the requesting agent.

    ShowConfirmationDialog

    Gets or sets a value indicating whether a write tool requires host confirmation.

    Declaration
    public bool ShowConfirmationDialog { get; set; }
    Property Value
    Type Description
    bool

    true to request confirmation before a write tool runs; otherwise, false. The default value is false.

    Remarks

    Read-only tools ignore this property. For write tools, setting it to true asks the host to confirm the operation before the handler runs.

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved