# `Phantom.Cache`
[🔗](https://github.com/dbernheisel/phantom_mcp/blob/main/lib/phantom/cache.ex#L1)

Storage for tooling specifications. The backend is `:persistent_term`.

You typically won't need to interact with `Phantom.Cache` directly, but
if you're registering new tooling within the runtime, then you may want
to use the functions herein.

# `add_prompt`

Add an MCP Prompt for the given router.

# `add_resource_template`
*macro* 

Add an MCP Resource Template for the given router.

This will also purge and generate a ResourceRouter module for each scheme
provided.

# `add_tool`

Add an MCP Tool for the given router.

# `list`

```elixir
@spec list(
  Phantom.Session.t() | nil,
  module(),
  :tools | :prompts | :resource_templates
) :: [
  Phantom.Tool.t() | Phantom.Prompt.t() | Phantom.ResourceTemplate.t()
]
```

List all the entities for the given type.

# `register`

Initialize the cache with compiled tooling for the given router.

You likely don't need to call this yourself, as `Phantom.Plug` will call it if needed.

---

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