const server = await api.mcp.get("example");
for (const tool of server.tools) {
console.log(tool.allowed ? "✓" : " ", tool.name, "—", tool.description);
}server = api.mcp.get("example")
for tool in server["tools"]:
print("✓" if tool["allowed"] else " ", tool["name"], "—", tool["description"])Each tool
namestringAs the server calls it.
descriptionstringWhat the model is told.
inputSchemaobjectIts parameters, as the server declared them.
allowedbooleanWhether it is declared to a model at all.
refresh re-reads the server
const server = await api.mcp.get("example", { refresh: true });server = api.mcp.get("example", refresh=True)| Without refresh | With refresh | |
|---|---|---|
| Contacts the server | no | yes — handshake and tool list |
| Costs | nothing | a round trip |
| Updates the catalogue | no | yes, and the agreed revision |
| Your allowed list | unchanged | kept |
Refreshing never widens what is allowed
The tools you had allowed stay allowed, and new ones the server has added arrive disallowed. A server cannot grant itself more surface by shipping more tools.
When to refresh
- A tool started failing with an argument error — its schema may have changed.
- The server announced new tools you want to allow.
lastErrorshows something, and you want to know whether it is still true.
The token comes back to its owner
get() returns it, because the package needs it to contact the server. It is encrypted at rest and never leaves for anyone else — which is also why it is not in list().