Declares a WebMCP tool.
API
function declareWebMcpTool<InputSchema extends JsonSchemaForInference>(
tool: ToolDescriptor<InputSchema>,
injector?: Injector | undefined,
): void;Description
Declares a WebMCP tool.
The tool is immediately registered and automatically unregistered when the associated injection context is destroyed.
The tool.execute function is invoked in the injection context of the provided
Injector, or the injection context of declareWebMcpTool itself.
Jump to details