pub async fn run_json<F>(
tool: &str,
check: Result<()>,
fut: F,
) -> CallToolResultExpand description
Run a permission check (or .and(...)-chained checks), then a future,
and wrap the JSON result. Errors are surfaced as a CallToolResult with
is_error: true (per MCP spec) rather than as a transport-level McpError,
so an AI agent client can recover without aborting its loop.