adk_mcp_catalog (erlang_adk v0.10.0)

View Source

Immutable, generation-based MCP tools/resources/prompts catalog.

A replacement validates and constructs all three registries before returning a new catalog. Existing snapshots remain immutable, so concurrent users can observe either the complete old generation or the complete new generation, never a mixed set. Entries are public JSON descriptors; executable handlers and credentials belong outside this catalog.

Summary

Functions

Content-free metadata suitable for logs and process diagnostics.

Return one deterministic page. Cursors are opaque, authenticated, and bound to the exact catalog generation and kind.

Types

catalog/0

-type catalog() :: {adk_mcp_catalog, 1, pos_integer(), binary(), binary(), binary(), snapshot()}.

kind/0

-type kind() :: tools | resources | prompts.

snapshot/0

-opaque snapshot()

Functions

describe(Catalog)

-spec describe(catalog() | snapshot()) -> {ok, map()} | {error, term()}.

Content-free metadata suitable for logs and process diagnostics.

generation(Catalog)

-spec generation(catalog() | snapshot()) -> {ok, pos_integer()} | {error, invalid_mcp_catalog}.

kinds()

-spec kinds() -> [kind()].

list(Catalog, Kind, Cursor, Limit)

-spec list(catalog() | snapshot(), kind(), undefined | binary(), pos_integer()) ->
              {ok, map()} | {error, term()}.

Return one deterministic page. Cursors are opaque, authenticated, and bound to the exact catalog generation and kind.

list_changed(OldCatalog, NewCatalog)

-spec list_changed(catalog() | snapshot(), catalog() | snapshot()) -> {ok, map()} | {error, term()}.

lookup(Catalog, Kind, Id)

-spec lookup(catalog() | snapshot(), kind(), binary()) -> {ok, map()} | {error, term()}.

new()

-spec new() -> {ok, catalog()}.

new(Definitions)

-spec new(map()) -> {ok, catalog()} | {error, term()}.

replace(Catalog, Definitions)

-spec replace(catalog() | snapshot(), map()) -> {ok, catalog()} | {error, term()}.

snapshot(Snapshot)

-spec snapshot(catalog() | snapshot()) -> {ok, snapshot()} | {error, invalid_mcp_catalog}.