# `AttestoMCP.Server.Registry`
[🔗](https://github.com/XukuLLC/attesto_mcp_server/blob/v2.8.0/lib/attesto_mcp_server/registry.ex#L1)

Deterministic, authorization-filtered MCP primitive registry.

# `definition`

```elixir
@type definition() :: map()
```

A normalized JSON-compatible primitive definition.

# `primitive`

```elixir
@type primitive() :: :tool | :resource | :template | :prompt | :completion
```

Supported registration categories.

# `registration`

```elixir
@type registration() :: {primitive(), String.t(), map() | keyword()}
```

One primitive registration supplied to the atomic batch API.

# `candidates`

```elixir
@spec candidates(pid(), :tool | :resource, String.t()) :: [definition()]
```

Returns definitions matching one wire-level tool name or exact resource URI.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `fetch`

```elixir
@spec fetch(pid(), primitive(), term()) :: {:ok, definition()} | :error
```

Returns one normalized definition without copying the complete catalog.

# `list`

```elixir
@spec list(pid(), primitive()) :: [definition()]
```

Returns definitions for one category in deterministic identity order.

# `register`

```elixir
@spec register(pid(), primitive(), String.t(), map() | keyword()) ::
  :ok | {:error, term()}
```

Validates and registers one primitive, rejecting duplicate identities.

# `register_all`

```elixir
@spec register_all(pid(), [registration()]) ::
  {:ok, [{primitive(), String.t(), definition()}]} | {:error, term()}
```

Validates and registers a batch atomically, returning its normalized definitions.

# `replace_all`

```elixir
@spec replace_all(pid(), [registration()]) ::
  {:ok, %{required(primitive()) =&gt; %{optional(term()) =&gt; definition()}},
   [primitive()]}
  | {:error, term()}
```

Validates and atomically replaces the complete primitive catalog.

# `revision`

```elixir
@spec revision(pid()) :: non_neg_integer()
```

Returns the monotonic catalog revision used for invalidation and recovery.

# `snapshot`

```elixir
@spec snapshot(pid()) :: %{
  required(primitive()) =&gt; %{optional(term()) =&gt; definition()}
}
```

Returns all normalized definitions grouped by primitive category.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Starts the registry; registration is serialized through this process.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
