MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / errorResult

Function errorResult

internal/mcp/server.go:219–224  ·  view source on GitHub ↗

errorResult wraps a message as a CallToolResult with IsError set. This is the MCP-spec way to tell the host that the tool *ran* but produced a recoverable error (vs the JSON-RPC-level error path which signals a protocol/transport failure).

(msg string)

Source from the content-addressed store, hash-verified

217// recoverable error (vs the JSON-RPC-level error path which signals a
218// protocol/transport failure).
219func errorResult(msg string) *mcp.CallToolResult {
220 return &mcp.CallToolResult{
221 IsError: true,
222 Content: []mcp.Content{&mcp.TextContent{Text: msg}},
223 }
224}
225
226// isJSONNull returns true when the raw JSON encodes a literal `null`, with
227// any surrounding whitespace tolerated.

Callers 1

registerToolMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected