> ## Documentation Index
> Fetch the complete documentation index at: https://gofastmcp.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# addressing

# `fastmcp.server.providers.addressing`

Deterministic tool hashing for backend-tool routing and per-tool resources.

Each FastMCPApp backend tool gets a deterministic hash computed from its
app name + tool name. The hash serves two purposes:

1. **Backend-tool routing.** Tools with `"app"` in their visibility are
   callable via `<hash>_<local_name>`. The dispatcher parses the prefix
   and calls `get_tool_by_hash`, which finds the tool whose stored hash
   matches and applies the same transforms, visibility, and auth as a lookup
   by the tool's listed name.

2. **Per-tool Prefab renderer URIs.** Each prefab tool gets a unique renderer
   resource at `ui://prefab/tool/<hash>/renderer.html`. `list_resources`
   and `read_resource` synthesize these on demand from the tool's meta.

The hash is computed at registration time from `(app_name, tool_name)` —
both known at that moment — and stored in `meta["fastmcp"]["tool_hash"]`.
Deterministic across replicas (same code → same hash), no registry walk
needed.

The key is deliberately public. Keys prefixed with `_` inside the
`fastmcp` meta namespace are stripped at every serialization boundary
(see `FastMCPComponent.get_meta`) because they hold process-local state
such as enabled/disabled marks. The hash is the opposite: a stable
identity that intermediaries need in order to recognize a tool they are
forwarding, so it must survive the wire.

## Functions

### `hash_tool` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/addressing.py#L44](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/addressing.py#L44)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
hash_tool(app_name: str, tool_name: str) -> str
```

Deterministic hex hash for a tool in an app.

Same inputs on every replica produce the same output.

### `tool_identity` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/addressing.py#L53](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/addressing.py#L53)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
tool_identity(tool: Tool) -> str | None
```

Read a tool's stored identity hash, if it carries one.

### `is_app_tool_with_identity` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/addressing.py#L65](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/addressing.py#L65)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
is_app_tool_with_identity(tool: Tool, tool_hash: str) -> bool
```

Whether a tool carries this identity hash and is callable by apps.

### `hashed_backend_name` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/addressing.py#L73](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/addressing.py#L73)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
hashed_backend_name(app_name: str, tool_name: str) -> str
```

Format the universal name for a backend tool: `<hash>_<local_name>`.

### `parse_hashed_backend_name` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/addressing.py#L78](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/addressing.py#L78)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
parse_hashed_backend_name(name: str) -> tuple[str, str] | None
```

Parse `<HASH_LENGTH hex>_<rest>` → `(hash, local_tool_name)` or None.

### `hashed_resource_uri` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/addressing.py#L90](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/addressing.py#L90)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
hashed_resource_uri(app_name: str, tool_name: str) -> str
```

Per-tool Prefab renderer resource URI.

### `parse_hashed_resource_uri` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/server/providers/addressing.py#L95](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/server/providers/addressing.py#L95)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
parse_hashed_resource_uri(uri: str) -> str | None
```

Extract the hash from a Prefab renderer URI, or None.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.