# `AgentDb.Mcp`
[🔗](https://github.com/manhvu/agent_db/blob/v0.1.0/lib/agent_db/mcp.ex#L1)

The MCP tool inventory over the store facade.

Pure mapping: tool names, JSON-RPC envelope handling, and direct in-process
invocation live here so they are usable without HTTP. The controller is a
thin wrapper that adds authentication (via the `:api` pipeline) and trace
extraction.

# `call_tool`

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

Invokes a tool by name with a map of arguments directly in-process.

Returns `{:ok, data}` on success or `{:error, reason}` on failure, without
JSON-RPC encoding, HTTP, or a network round-trip. `opts` may carry
`:trace_context` propagated to store operations that accept it.

# `handle_request`

```elixir
@spec handle_request(map(), keyword()) :: map()
```

Handles one JSON-RPC request map.

Returns a response map with `jsonrpc: "2.0"`. `opts` may carry
`:trace_context` propagated to store operations that accept it.

# `tools`

```elixir
@spec tools() :: [map()]
```

The MCP tool inventory served by `tools/list`.

---

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