List a user's World tools
Load the integration commands, runtimes, and mounts available to a represented user in a World, for your agent's context.
/api/v1/worlds/:worldId/toolsRegister your user before the first lookup. Registration is safe to repeat. Pass that same user ID when discovering tools and running commands.
const response = await fetch("https://api.smallworld.sh/api/v1/worlds/01995e56-e2d4-7f19-b691-7bf9af6abdc8/tools?userId=customer_123", {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
Use your server-side apiKey. Replace the example IDs.
Path parameters#
worldIdUUIDrequiredThe World ID shown in the dashboard.
Query parameters#
userIdstringrequiredYour application's user ID. This represented user must already exist.
groupIdstringYour application's group ID: which of the user's groups the result is for. Omit it for a user with no group or one group. Required when the user belongs to several groups. URL-encode it.
Responses#
Returns items, without a pagination cursor, capabilities, and mounts. Tools include integration, original toolName, terminal command, description, and inputSchema. capabilities.python and capabilities.javascript indicate whether python3 and js-exec are enabled in this World. mounts lists the folders mounted into the user's terminal in a session for the selected group, sorted by path, each with id, path, nullable description, and settings (create, update, delete, move, and rename, each allow, ask, or deny).
{
"items": [
{
"integration": "acme",
"toolName": "get_order",
"command": "acme get-order",
"description": "Read an order by its ID.",
"inputSchema": {
"type": "object",
"properties": {
"orderId": {
"type": "string",
"description": "The order ID."
}
},
"required": [
"orderId"
],
"additionalProperties": false
}
}
],
"capabilities": {
"python": true,
"javascript": true
},
"mounts": [
{
"id": "0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d",
"path": "/workspace/docs",
"description": "Product documentation. Answers to customer questions go in faq.md.",
"settings": {
"create": "allow",
"update": "ask",
"delete": "ask",
"move": "ask",
"rename": "ask"
}
}
]
}
More about this endpoint
Call POST /users once before discovery. It safely returns an existing user when called again. Execution and connect-session creation also register users automatically.
The catalog depends on World settings and on the connection the user's calls use for each integration in a session for the selected group: their own, or that group's when they have none. Load it at the start of an agent turn rather than hardcoding provider tools.
groupId follows the rules of a new session in POST /worlds/:worldId/execute. Without it, a user with no groups is read without a group and a user with one group is read for that group. A user in several groups needs groupId. Pass the groupId of the session your agent runs in.
To call a tool, execute its command with --json, or use await tools.<integration>.<toolName>(input) inside js-exec when JavaScript is enabled. Ask policies can still require approval.
Built-in terminal commands are not enumerated in items. Capabilities describe the optional Python and JavaScript runtimes.
mounts lists only the mounts the user's commands get: global mounts, the selected group's, and their own, without those a broader mount shadows. They are the same in every World. Tell your agent that reading them is always allowed, and that deny makes a change fail with Permission denied while ask holds the mount's changes for approval at the end of the command.