Delegate McpRequestInvocationFilter<TParams, TResult>
- Namespace
- ModelContextProtocol.Server
- Assembly
- ModelContextProtocol.Core.dll
Delegate type for filtering a single incoming MCP request invocation.
[Experimental("MCPEXP002", UrlFormat = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp002")]
public delegate ValueTask<TResult> McpRequestInvocationFilter<TParams, TResult>(RequestContext<TParams> context, McpRequestHandler<TParams, TResult> next, CancellationToken cancellationToken)
Parameters
contextRequestContext<TParams>The context for the current request.
nextMcpRequestHandler<TParams, TResult>The next request handler in the pipeline for this invocation.
cancellationTokenCancellationTokenThe cancellation token for the current request.
Returns
- ValueTask<TResult>
The result of the filtered request invocation.
Type Parameters
TParamsThe type of the parameters sent with the request.
TResultThe type of the response returned by the handler.