Class GridWebMcpSettings
Represents the WebMCP configuration for an SfGrid<TValue> instance.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.Grids
Assembly: Syncfusion.Blazor.Grids.dll
Syntax
public class GridWebMcpSettings : SfDataBoundComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
Use this component to customize the WebMCP tools exposed by a grid to compatible AI agents. Built-in tools can be disabled, customized, or replaced, and additional custom tools can be registered through GridWebMcpTool child components.
Custom tool execution is handled through the OnWebMcpExecute event.
This component is effective only when
EnableWebMcp is true and
the hosting environment supports the browser's
document.modelContext API.
Examples
<SfGrid DataSource="@Orders" EnableWebMcp="true"> <GridWebMcpSettings Name="SalesGrid"> <GridWebMcpTools> <GridWebMcpTool Command="GridWebMcpToolCommand.FilterByColumn" Name="filterOrders" /> </GridWebMcpTools> </GridWebMcpSettings> </SfGrid>
Constructors
GridWebMcpSettings()
Declaration
public GridWebMcpSettings()
Properties
Name
Gets or sets the prefix used when generating browser-side WebMCP tool names for this grid instance.
Declaration
[Parameter]
[JsonIgnore]
public string? Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string that defines the prefix applied to all tool names
registered by this grid. When null or empty, the grid
falls back to its configured |
Remarks
When specified, this value takes precedence over the grid's ID
when generating browser-side tool names during WebMCP registration.
Tool names must be unique within the browser-side WebMCP tool registry.
When multiple WebMCP-enabled grids are rendered on the same page,
configure a unique Name value for each grid to avoid tool
registration conflicts.
This prefix is combined with the configured tool name to produce the fully qualified tool identifier exposed through Name.
This property is not serialized and must be supplied directly through the component instance.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
OnInitializedAsync()
Initializes the settings component, hooks it into the parent
grid, and signals that the tool registry needs to be re-resolved
on the next render via
BaseParent.HasWebMcpSettingsChanges.
Declaration
protected override Task OnInitializedAsync()
Returns
| Type |
|---|
| Task |
Overrides
OnParametersSetAsync()
Detects mutations on the allowlist and flips
BaseParent.HasWebMcpSettingsChanges so the next
registration call re-resolves the effective tool catalog.
Mirrors the pattern used by
OnParametersSetAsync().
Declaration
protected override Task OnParametersSetAsync()
Returns
| Type |
|---|
| Task |