Cadmpeg.Mcp.Tools (ExCadmpeg v0.1.0)

Copy Markdown View Source

The tools the MCP server offers, and the one place a name becomes a function.

A tool answers {:ok, %{text: text, structured: map}, state} or {:error, message, state}. The text is what a model reads; the structured part is the same answer for a program that would rather not parse prose. The protocol layer turns the second form into isError, which is how the specification says "this call failed, the message says how" rather than "the server is broken".

Two tools read and one writes: cadmpeg_convert puts a file where the caller named it and nothing else.

Where the files come from

A call names a path, and the server keeps the document it opened, so asking three questions about one file reads it once — and a tool never takes a handle from a caller, because a handle is not something a model should have to hold.

Summary

Functions

One tool call: its answer and the state after it.

The tools, as the protocol wants them listed.

Functions

call(name, arguments, state)

@spec call(String.t(), map(), Cadmpeg.Mcp.state()) ::
  {atom(), term(), Cadmpeg.Mcp.state()}

One tool call: its answer and the state after it.

catalogue()

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

The tools, as the protocol wants them listed.