Backplane.McpProtocol.Client.Catalog (backplane_mcp_protocol v0.5.0)

Copy Markdown

Compiles a tool list into an immutable snapshot for parameter-header projection.

A tool is retained only when every x-mcp-header annotation in its input schema is attached to a primitive property reachable through properties entries alone.

Summary

Functions

Removes the calling process's snapshot for key.

Compiles raw tools into one immutable catalog snapshot.

Returns the calling process's current snapshot for key.

Returns an empty catalog snapshot.

Projects declared argument values into Mcp-Param-* headers.

Stores one filtered page and merges it only when its request cursor continues the active chain.

Compiles and atomically replaces a snapshot in the calling process.

Returns the raw tools retained in a compiled snapshot.

Types

path()

@type path() :: [String.t()]

projection()

@type projection() :: {path(), String.t()}

t()

@type t() :: %Backplane.McpProtocol.Client.Catalog{
  next_cursor: String.t() | nil,
  projections: %{optional(String.t()) => [projection()]},
  tools: [map()]
}

Functions

cleanup(key)

@spec cleanup(term()) :: :ok

Removes the calling process's snapshot for key.

compile(tools)

@spec compile([map()]) :: t()

Compiles raw tools into one immutable catalog snapshot.

current(key)

@spec current(term()) :: t()

Returns the calling process's current snapshot for key.

empty()

@spec empty() :: t()

Returns an empty catalog snapshot.

parameter_headers(catalog, tool_name, arguments)

@spec parameter_headers(t(), String.t(), map()) :: {:ok, map()} | {:error, term()}

Projects declared argument values into Mcp-Param-* headers.

put_page(key, request_cursor, next_cursor, tools)

@spec put_page(term(), String.t() | nil, String.t() | nil, [map()]) :: {[map()], t()}

Stores one filtered page and merges it only when its request cursor continues the active chain.

replace(key, tools)

@spec replace(term(), [map()]) :: t()

Compiles and atomically replaces a snapshot in the calling process.

tools(catalog)

@spec tools(t()) :: [map()]

Returns the raw tools retained in a compiled snapshot.