The router and sessions
A custom MCP server lists every tool of its toolkits. That works for one app. For an assistant that may need any app, the list gets long and expensive. The router lists five tools instead:
| Tool | What it does |
|---|---|
PTM_SEARCH_TOOLS | Finds tools for a task described in plain words, and says which apps the user has connected. |
PTM_GET_TOOL_SCHEMAS | Returns the input schema of named tools. |
PTM_MULTI_EXECUTE_TOOL | Runs up to 20 tool calls in parallel and returns one result each. |
PTM_MANAGE_CONNECTIONS | Lists, starts (returns a connect link) or removes the user's connections. |
PTM_WAIT_FOR_CONNECTION | Waits up to 50 seconds for the user to finish connecting an app. |
Create a router server
In the dashboard, MCP servers → New → Router. Leave toolkits empty to allow the whole catalogue, or pick some to limit it. Connect it like any server: https://www.prompt-tm.com/mcp/mcp_...?user_id=alice.
When the user asks for an app with no auth config in your project yet, the router creates a default one: managed OAuth where we have an app, otherwise the app's key method.
Sessions
A session is a router bound to one user, created from your backend:
curl -X POST https://www.prompt-tm.com/api/v3/tool_router/session \
-H "x-api-key: $PROMPT_TM_KEY" -H "content-type: application/json" \
-d '{ "user_id": "alice", "toolkits": ["github", "vercel", "slack"] }'
{
"session_id": "trs_...",
"mcp": { "type": "http", "url": "https://www.prompt-tm.com/mcp/trs_..." },
"tool_router_tools": ["PTM_SEARCH_TOOLS", "..."]
}
The session URL needs no user_id. Delete it with DELETE /api/v3/tool_router/session/{id}.