# List a session's tool calls

`GET /o/{org}/p/{project}/sessions/{session}/tool-calls`

Indexed from the captured transcript, in call order. `program` is the command a shell call ran (`git`, `bun`), so it can be filtered without reading inputs.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org` | path | string | yes | The org's slug or id. A caller with no role in the org gets `404`. |
| `project` | path | string | yes | A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning "no Project" (a direct-repo / repo-less dispatch on `POST`; "no Project constraint, resolve by session id alone" everywhere else). A real handle that doesn't match the session's actual Project is `404`.  |
| `session` | path | string | yes | The session's full id (`execution_id`). |
| `tool` | query | string | no | Only this tool. |
| `program` | query | string | no | Only calls that ran this program, e.g. `git`. |
| `outcome` | query | string | no |  |
| `limit` | query | integer | no |  |

## Example request

```bash
curl "https://api.prix.dev/o/$RUSH_ORG/p/_/sessions/$SESSION_ID/tool-calls" \
  -H "Authorization: Bearer $RUSH_API_KEY"
```

```typescript
const org = process.env.RUSH_ORG;
const sessionId = process.env.SESSION_ID;

const res = await fetch(`https://api.prix.dev/o/${org}/p/_/sessions/${sessionId}/tool-calls`, {
  headers: {
    Authorization: `Bearer ${process.env.RUSH_API_KEY}`,
  },
});

console.log(res.status, await res.json());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]
session_id = os.environ["SESSION_ID"]

res = requests.get(
    f"https://api.prix.dev/o/{org}/p/_/sessions/{session_id}/tool-calls",
    headers={"Authorization": f"Bearer {os.environ['RUSH_API_KEY']}"},
)

print(res.status_code, res.json())
```

## Responses

### 200

The tool calls.

- `tool_calls` (array of ToolCall, required)
  - `call_key` (string, required)
  - `ordinal` (integer, optional)
  - `tool` (string, required)
  - `program` (string | null, optional): The first program a shell call ran.
  - `programs` (array of string, optional): Every program a shell call ran.
  - `input` (string | null, optional)
  - `outcome` (string | null, optional, one of `success`, `error`, `cancelled`, `null`)
  - `exit_code` (integer | null, optional)
  - `error_code` (string | null, optional)
  - `end_timestamp` (string | null, optional)

### 400

An unknown `outcome`.

### 401

No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.

### 404

No such resource for the caller, including one that exists in an org the caller cannot see.

## Example response (200)

```json
{
  "tool_calls": [
    {
      "call_key": "toolu_01HkQx7",
      "ordinal": 0,
      "tool": "Bash",
      "program": "bun",
      "programs": [
        "bun"
      ],
      "input": "{\"command\":\"bun test checkout.spec.ts\"}",
      "outcome": "error",
      "exit_code": 1,
      "error_code": "v1:Bash:exit-1",
      "end_timestamp": "2026-10-06T15:03:40.511Z"
    }
  ]
}
```
