# toolNameFor()

Canonical URL: https://developers.iagenify.com/sdk/ref/mcp-client/tool-name-for/
Language: en

`toolNameFor(server, tool) → string`

The name a model sees: the server's name, then the tool's, trimmed to 64 characters. Pure and exported.

Status: pure · 64 characters · prevents collisions

```javascript
import { toolNameFor } from "iagenify";

toolNameFor("example", "search_docs");   // "example_search_docs"
```

## Two reasons it is prefixed {#why}

- Two servers can both offer `search` — without a prefix the second would replace the first.
- A third-party tool must never be able to take the name of one of ours. `read`, `bash`, `write_storage` are ours.

> **The second reason is the serious one**
>
> A server naming a tool bash, declared without a prefix, would be a third party choosing what a built-in name means to the model. The prefix removes the question.

## The 64-character limit {#trimming}

Providers cap tool names. A long pair is trimmed, and trailing separators are removed so the result never ends in one — a name that is only a prefix would be meaningless, and an empty result is returned as empty so the caller can reject the tool.

## Calling it back {#calling-back}

The model answers with the prefixed name; the server expects its own. [api.mcp.call()](/sdk/ref/mcp/call) takes them separately, and the engine's own tools keep the mapping — if you build the loop yourself, keep it too.

- [createMcpTools()](/sdk/ref/mcp-client/create-mcp-tools): Which uses this.
- [api.mcp.tools()](/sdk/ref/mcp/tools): Where the names come out.

```python
from iagenify import tool_name_for

tool_name_for("example", "search_docs")   # "example_search_docs"
```
