Delegate McpRequestHandler<TParams, TResult>
- Namespace
- ModelContextProtocol.Server
- Assembly
- ModelContextProtocol.Core.dll
Delegate type for handling incoming MCP requests with specific parameter and result types.
public delegate ValueTask<TResult> McpRequestHandler<TParams, TResult>(RequestContext<TParams> request, CancellationToken cancellationToken)
Parameters
requestRequestContext<TParams>The request context containing the parameters and other metadata.
cancellationTokenCancellationTokenThe CancellationToken to monitor for cancellation requests. The default is None.
Returns
- ValueTask<TResult>
A task representing the asynchronous operation, with the result of the handler.
Type Parameters
TParamsThe type of the parameters sent with the request.
TResultThe type of the response returned by the handler.