# List a session's tool calls

Read every tool call of a session, newest first, one page at a time, with each one's executionId.

`GET https://api.smallworld.sh/api/v1/sessions/:sessionId/tool-calls`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| sessionId | path | UUID | Yes | The session ID returned in session.id. |
| cursor | query | string | No | The opaque nextCursor from a previous page of this same list and session. Omit for the first page. |
| limit | query | integer | No | Number of items to return, from 1 to 50. Defaults to 20. |

## Request examples

### curl

```curl
curl --fail-with-body -X GET 'https://api.smallworld.sh/api/v1/sessions/01995e57-0501-76b8-b797-5b24df5b307f/tool-calls?limit=20' \
  -H "Authorization: Bearer $SMALLWORLD_API_KEY"
```

### typescript

```typescript
const response = await fetch("https://api.smallworld.sh/api/v1/sessions/01995e57-0501-76b8-b797-5b24df5b307f/tool-calls?limit=20", {
  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/sessions/01995e57-0501-76b8-b797-5b24df5b307f/tool-calls?limit=20",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Responses

Returns items and nextCursor. Each item is a tool call as GET /tool-approvals returns it, with argumentsTruncated and resultTruncated. Arguments and results longer than 16 KB of JSON are returned as their JSON text cut to 16 KB, a string; a text result is cut as text.

### 200

Returns items and nextCursor. Each item is a tool call as GET /tool-approvals returns it, with argumentsTruncated and resultTruncated. Arguments and results longer than 16 KB of JSON are returned as their JSON text cut to 16 KB, a string; a text result is cut as text.

```json
{
  "items": [
    {
      "id": "b5212df0-ea8b-4eb8-a7b1-057ff45b3044",
      "sessionId": "01995e57-0501-76b8-b797-5b24df5b307f",
      "executionId": "01995e57-3027-7557-a233-009ea3dcd8fc",
      "userId": "customer_123",
      "worldId": "01995e56-e2d4-7f19-b691-7bf9af6abdc8",
      "integration": "acme",
      "integrationName": "Acme",
      "account": null,
      "connectionSource": "none",
      "group": null,
      "toolName": "get_order",
      "toolDescription": "Read an order by its ID.",
      "toolLabel": "read",
      "arguments": {
        "orderId": "order_456"
      },
      "status": "completed",
      "result": {
        "orderId": "order_456",
        "status": "shipped"
      },
      "error": null,
      "errorCode": null,
      "reason": null,
      "providerApproval": null,
      "hooks": [],
      "createdAt": "2026-10-10T12:00:00.000Z",
      "expiresAt": "2026-10-10T12:15:00.000Z",
      "completedAt": null,
      "decidedAt": null,
      "argumentsTruncated": false,
      "resultTruncated": false
    }
  ],
  "nextCursor": null
}
```

### 400

invalid_request: A query parameter is invalid, such as a limit above 50 or a cursor from another list or session; the message names the problem. Unknown query parameters are rejected.

#### invalid_request

A query parameter is invalid, such as a limit above 50 or a cursor from another list or session; the message names the problem. Unknown query parameters are rejected.

```json
{
  "statusCode": 400,
  "code": "invalid_request",
  "message": "limit must be an integer between 1 and 50"
}
```

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

session_not_found: The session does not exist in your workspace.

#### session_not_found

The session does not exist in your workspace.

```json
{
  "statusCode": 404,
  "code": "session_not_found",
  "message": "Session not found"
}
```

### 500

internal_error: An unexpected server error.

#### internal_error

An unexpected server error.

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

## Notes

- Items are newest first. Pass nextCursor to read older items; it is null on the final page.

- A cursor works only for the list and session that returned it.

- GET /executions/:executionId returns the full arguments and results of its tool calls.
