pub async fn route_tools<TH>(
handler: &TH,
method: &str,
params: Option<&Value>,
ctx: &Context<'_>,
) -> Option<Result<Value, McpError>>Expand description
Route tool-related requests to a handler implementing ToolHandler.
This function handles tools/list and tools/call methods.
Returns None if the method is not tool-related.
§Example
ⓘ
if let Some(result) = route_tools(&handler, method, params, &ctx).await {
return result;
}