Lemma.Mcp (lemma_engine v0.9.9)

Copy Markdown View Source

Pure Lemma MCP tools: engine + JSON args in, catalog or tool result text out.

Read tools mirror the engine catalog: run, list, show, source, check, guide. Admin/write tools stay in the CLI MCP server only.

run/2 always includes explanations and returns formatted ASCII trees (plus a Missing data block when inputs are unbound). Args match SDK run: spec, optional repository, rules, data (object), effective. Do not pass explain.

Summary

Types

args()

@type args() :: map()

engine()

@type engine() :: Lemma.engine()

Functions

check(args)

@spec check(args()) ::
  {:ok, String.t()}
  | {:error, :invalid_arguments | :not_found | :diagnostics, String.t()}

evaluate(engine, args)

@spec evaluate(engine(), args()) ::
  {:ok, String.t()}
  | {:error, :invalid_arguments | :not_found | :diagnostics, String.t()}

Deprecated alias of run/2. Prefer Lemma.Mcp.run/2.

guide(args)

@spec guide(args()) ::
  {:ok, String.t()}
  | {:error, :invalid_arguments | :not_found | :diagnostics, String.t()}

list(engine, args)

@spec list(engine(), args()) ::
  {:ok, String.t()}
  | {:error, :invalid_arguments | :not_found | :diagnostics, String.t()}

list_resources()

@spec list_resources() :: {:ok, [map()]} | {:error, term()}

list_tools()

@spec list_tools() :: {:ok, [map()]} | {:error, term()}

read_resource(uri)

@spec read_resource(String.t()) ::
  {:ok, String.t()} | {:error, :unknown_uri, String.t()}

run(engine, args)

@spec run(engine(), args()) ::
  {:ok, String.t()}
  | {:error, :invalid_arguments | :not_found | :diagnostics, String.t()}

show(engine, args)

@spec show(engine(), args()) ::
  {:ok, String.t()}
  | {:error, :invalid_arguments | :not_found | :diagnostics, String.t()}

source(engine, args)

@spec source(engine(), args()) ::
  {:ok, String.t()}
  | {:error, :invalid_arguments | :not_found | :diagnostics, String.t()}