Mead.MCP.Server.Tools (mead v0.1.1)

Copy Markdown View Source

The nine tools the MCP server offers: start_session, submit_turn, history, stop_session, resume_session, delete_session, list_sessions, compact_session, and usage. They are the only code of the server that touches the runtime, and they do it only through the public Mead API.

A tool never raises for what a client can send. Arguments of the wrong type come back as {:error, {:invalid_params, message}}, which the dispatcher turns into a JSON-RPC error. What goes wrong while the tool runs (an unknown session, a failed turn, a timeout) comes back as an ordinary result with "isError" => true and a short fixed message: no stack trace, no provider text, no internal term.

Summary

Types

context()

@type context() :: %{allow_effect: boolean()}

Functions

call(arg1, arguments, context)

@spec call(term(), map(), context()) ::
  {:ok, map()}
  | {:error, :unknown_tool}
  | {:error, {:invalid_params, String.t()}}

definitions()

@spec definitions() :: [map()]