# `ExMCP.Server.Tools.Registry`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/server/tools/registry.ex#L1)

Runtime tool registry that manages tool definitions and handlers.

> #### Deprecated {: .warning}
>
> Part of the deprecated `ExMCP.Server.Tools` API. **Planned for removal in 2.0.0.**
> Prefer declarative tools via `ExMCP.Server.DSL`, or implement dynamic
> lists with `ExMCP.Server.Handler` callbacks.

This module provides a simpler alternative to compile-time metaprogramming
by using runtime registration of tools.

# `handler`

```elixir
@type handler() :: (map(), any() -&gt;
                {:ok, any()} | {:ok, any(), any()} | {:error, any()})
```

# `tool_definition`

```elixir
@type tool_definition() :: %{
  optional(atom()) =&gt; any(),
  name: String.t(),
  description: String.t(),
  inputSchema: map() | boolean(),
  outputSchema: map() | boolean() | nil
}
```

# `call_tool`

```elixir
@spec call_tool(GenServer.server(), String.t(), map(), any()) ::
  {:ok, any()} | {:ok, any(), any()} | {:error, any()}
```

Calls a tool by name.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get_tool`

```elixir
@spec get_tool(GenServer.server(), String.t()) ::
  {:ok, {tool_definition(), handler()}} | {:error, :not_found}
```

Gets a tool's definition and handler.

# `list_tools`

```elixir
@spec list_tools(GenServer.server()) :: [tool_definition()]
```

Lists all registered tools.

# `register_tool`

```elixir
@spec register_tool(GenServer.server(), tool_definition(), handler()) :: :ok
```

Registers a tool with its handler.

# `register_tools`

```elixir
@spec register_tools(GenServer.server(), [{tool_definition(), handler()}]) :: :ok
```

Registers multiple tools at once.

# `start_link`

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

Starts the tool registry.

---

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