import { toolNameFor } from "iagenify";
toolNameFor("example", "search_docs"); // "example_search_docs"from iagenify import tool_name_for
tool_name_for("example", "search_docs") # "example_search_docs"Two reasons it is prefixed
- 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_storageare ours.
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
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
The model answers with the prefixed name; the server expects its own. api.mcp.call() takes them separately, and the engine's own tools keep the mapping — if you build the loop yourself, keep it too.