# 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.

`GET https://api.smallworld.sh/api/v1/worlds/:worldId/tools`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| worldId | path | UUID | Yes | The World ID shown in the dashboard. |
| userId | query | string | Yes | Your application's user ID. This represented user must already exist. |
| groupId | query | string | No | Your 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. |

## Request examples

### curl

```curl
curl --fail-with-body -X GET 'https://api.smallworld.sh/api/v1/worlds/01995e56-e2d4-7f19-b691-7bf9af6abdc8/tools?userId=customer_123' \
  -H "Authorization: Bearer $SMALLWORLD_API_KEY"
```

### typescript

```typescript
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();
```

### python

```python
response = requests.get(
    "https://api.smallworld.sh/api/v1/worlds/01995e56-e2d4-7f19-b691-7bf9af6abdc8/tools?userId=customer_123",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## 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).

### 200

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).

```json
{
  "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"
      }
    }
  ]
}
```

### 400

invalid_request: A parameter is invalid; the message names the problem. Unknown query parameters are rejected. group_required: The user belongs to several groups and the request has no groupId.

#### invalid_request

A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

```json
{
  "statusCode": 400,
  "code": "invalid_request",
  "message": "Unknown query parameter: color"
}
```

#### group_required

The user belongs to several groups and the request has no groupId.

```json
{
  "statusCode": 400,
  "code": "group_required",
  "message": "This user belongs to several groups. Send groupId to choose one."
}
```

### 401

authentication_required: The Authorization header is missing or empty. invalid_api_key: The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

#### authentication_required

The Authorization header is missing or empty.

```json
{
  "statusCode": 401,
  "code": "authentication_required",
  "message": "Authentication is required"
}
```

#### invalid_api_key

The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

```json
{
  "statusCode": 401,
  "code": "invalid_api_key",
  "message": "The API key is invalid or revoked"
}
```

### 403

ip_not_allowed: The request came from an address outside the workspace's IP allowlist.

#### ip_not_allowed

The request came from an address outside the workspace's IP allowlist.

```json
{
  "statusCode": 403,
  "code": "ip_not_allowed",
  "message": "The source IP address is not allowed by this account's security settings"
}
```

### 404

group_not_found: groupId names a group that does not exist in your workspace. world_not_found: The World does not exist in your workspace. user_not_found: The represented user does not exist in your workspace.

#### group_not_found

groupId names a group that does not exist in your workspace.

```json
{
  "statusCode": 404,
  "code": "group_not_found",
  "message": "Group not found"
}
```

#### world_not_found

The World does not exist in your workspace.

```json
{
  "statusCode": 404,
  "code": "world_not_found",
  "message": "World not found"
}
```

#### user_not_found

The represented user does not exist in your workspace.

```json
{
  "statusCode": 404,
  "code": "user_not_found",
  "message": "User not found"
}
```

### 409

user_not_in_group: groupId names a group the user does not belong to.

#### user_not_in_group

groupId names a group the user does not belong to.

```json
{
  "statusCode": 409,
  "code": "user_not_in_group",
  "message": "The user does not belong to this group"
}
```

### 500

internal_error: An unexpected server error.

#### internal_error

An unexpected server error.

```json
{
  "statusCode": 500,
  "code": "internal_error",
  "message": "Internal server error"
}
```

## Notes

- 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.
