import { createMcpTools } from "iagenify";
const servers = await api.mcp.forAgent(["example"]);
const tools = createMcpTools(servers);
// { example_search_docs: { description, parameters, category, run } }from iagenify import create_mcp_tools
servers = api.mcp.for_agent(["example"])
tools = create_mcp_tools(servers)
# {"example_search_docs": {"description", "parameters", "category", "run"}}The shape
| Field | From |
|---|---|
description | The server's tool description. |
parameters | Its schema, sanitised. |
category | The server's, not the tool's. |
run | Calls the server, carrying any header annotations. |
The category is the server's
It is declared by the server about itself, which is not proof. A third-party tool running without a permission in auto mode would be the worst possible regression here, so the category comes from the connection — exec by default.
clients reuses connections
Pass a map and the clients built for each server are kept in it, so a run calling several tools of one server shakes hands once.
The engine does this itself
agents.create({ mcp }) calls forAgent() and then this, every run. Use it directly only when you are assembling a tool catalogue of your own.