ExMCP.ErrorHelpers (ex_mcp v0.9.0)

View Source

Helper functions for creating ExMCP.Error structs. This module provides backward compatibility for tests.

Summary

Functions

Creates a connection error that returns a main Error struct.

Creates an error struct from a JSON-RPC error response.

Creates an internal error.

Creates an invalid params error.

Creates an invalid request error.

Creates a method not found error.

Creates a prompt error for the Error struct format.

Creates a resource error for the Error struct format.

Creates a tool error for the Error struct format.

Functions

connection_error(details)

Creates a connection error that returns a main Error struct.

connection_error(details, opts)

from_json_rpc_error(json_error, opts \\ [])

Creates an error struct from a JSON-RPC error response.

internal_error(details, opts \\ [])

Creates an internal error.

invalid_params(details, opts \\ [])

Creates an invalid params error.

invalid_request(details, opts \\ [])

Creates an invalid request error.

method_not_found(method, opts \\ [])

Creates a method not found error.

parse_error(details \\ "", opts \\ [])

Creates a parse error.

prompt_error(details, prompt_name, opts \\ [])

Creates a prompt error for the Error struct format.

resource_error(details, uri, opts \\ [])

Creates a resource error for the Error struct format.

tool_error(details, tool_name \\ nil, opts \\ [])

Creates a tool error for the Error struct format.