> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rasen.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rasen.ai/_mcp/server.

# List one tool's runs with request and result

GET https://api.rasen.ai/v1/agents/{agent_id}/tools/{tool_id}/runs

Runs of one webhook or MCP tool across the agent's calls, newest first by started_at then id. Each run carries the filtered arguments and result, the registered error code and the webhook HTTP status. Payloads of runs recorded while capture was off are null. Requires calls.read. A run of the agent's before-call tool has timing pre_call and no model arguments.

Reference: https://docs.rasen.ai/api-reference/agents/list-tool-runs

## Authentication

- `Authorization` header (bearer token, required) — Create and manage workspace-owned keys through the existing app session routes, outside this public API. Creator and manager identities are audit actors only. Key validity follows workspace policy, expiry and explicit revocation, independently of creator membership. Do not include a workspace-selection header.

## Request

### Path parameters

- `agent_id` (string, required) — Resource identity within the authenticated workspace.
- `tool_id` (string, required) — Resource identity within the authenticated workspace.

### Query parameters

- `limit` (integer, optional, default: 50) — Page size; 50 by default, at most 200.
- `cursor` (string, optional) — Opaque cursor bound to the workspace, every filter, grouping and limit. Send them unchanged with it. Expires after 24 hours.
- `call_id` (string, optional) — Only the runs of this call.
- `state` (list of string, optional) — Exact run state filter. Known values: pending, succeeded, failed, indeterminate. Invalid filters are refused, not ignored. Repeat for OR; AND with other fields. Omission means no filter.
- `start` (datetime, optional) — Inclusive UTC timestamp. Range must be at most 93 days.
- `end` (datetime, optional) — Exclusive UTC timestamp. Default range is trailing 30 days.

## Response

### 200

List one tool's runs with request and result.

- `items` (list of ToolRun, required)
- `next_cursor` (string, required, nullable) — Opaque continuation cursor. Null means the last page.

## Errors

### 400 Bad Request Error

Invalid input or cursor. Correct the request.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 401 Unauthorized Error

Invalid, expired or revoked API key. Creator departure or membership changes do not invalidate a workspace key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 403 Forbidden Error

Operation not allowed by current credential or workspace access.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 404 Not Found Error

Resource absent or not visible in this workspace.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 429 Too Many Requests Error

Rate limited. Respect Retry-After and retry the same intent where permitted.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 500 Internal Server Error

Internal error. The effect may have happened. Retry the same request with the same Idempotency-Key; read the resource before creating a new intent. For an operation that takes an Idempotency-Key, a client retry with the same key is safe: the server replays the stored outcome if the first attempt took effect; if the first attempt had no effect, the retry performs the operation once. Never retry with a new key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 503 Service Unavailable Error

Service unavailable. Respect Retry-After where present. For an operation that takes an Idempotency-Key, a client retry with the same key is safe: the server replays the stored outcome if the first attempt took effect; if the first attempt had no effect, the retry performs the operation once. Never retry with a new key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

## Types

### ToolRun

One run of one webhook or MCP tool, with its filtered request and result. Never a credential, resolved header, URL path or query, or provider exception. indeterminate means the effect is unknown; never automatically rerun it.

- `id` (string, required) — Opaque run identifier, the same as in listCallToolOutcomes. Do not parse its contents.
- `call_id` (string, required) — Opaque call identifier. Do not parse its contents.
- `tool_id` (string, required) — Authored tool identity of the webhook or MCP tool.
- `tool_name` (string, required)
- `kind` (string, required) — Open response vocabulary. Preserve unknown values; never assume they mean success.
- `state` (string, required) — Open response vocabulary. Preserve unknown values; never assume they mean success.
- `started_at` (datetime, required)
- `ended_at` (datetime, required, nullable)
- `reason` (string, required, nullable) — Registered reason code of a run that did not succeed; null on success, while pending or for an unregistered reason.
- `latency_ms` (integer, required, nullable) — Milliseconds the broker measured for the run; null until it has a result.
- `http_status` (integer, required, nullable) — HTTP status of the webhook response that arrived; null for MCP and when no response arrived.
- `arguments` (map from string to any, required, nullable) — The model's arguments after credential filtering. A cut snapshot holds only _truncated_json, a filtered JSON prefix that is not a complete object. Null when the run was recorded with argument capture off.
- `arguments_truncated` (boolean, required, nullable) — True when arguments was cut at 32,768 bytes; null when argument capture was off.
- `result` (any, required, nullable) — The tool's result after credential filtering: the parsed response body (also for a webhook failure), the MCP tool content, or null for a refused, timed-out, uncertain or oversized run and when result capture was off. A cut snapshot is an object holding only _truncated_json.
- `result_truncated` (boolean, required, nullable) — True when result was cut at 32,768 bytes; null when result capture was off.
- `error_message` (string, required, nullable) — The registry message of reason. Never provider or downstream text.
- `timing` (string, required) — Open response vocabulary. Preserve unknown values; never assume they mean success. pre_call: a run of the agent's before-call tool, sent before the platform answered an inbound call. during_call: every other run.

### ErrorResponseError

Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

- `code` (string, required) — Stable code. Branch on code (and details.reason for conflict), never on message. Each code has one HTTP status; see components.x-error-catalog.
- `message` (string, required) — Safe description; no provider payload or submitted secrets.
- `details` (map from string to any, optional) — Safe code-specific details. The public fields for each code are listed in components.x-error-catalog. Details never contain a request fingerprint, a hash of a request, secret material or another tenant's data. forbidden may include required_capabilities (a list).
- `request_id` (string, optional) — Same value as the X-Request-Id header. Quote it to support.
- `retry` (string, optional) — Retry class of this code: no (fix the request or state first), yes (retry the same request and the same Idempotency-Key), retry_after (wait for Retry-After, then retry the same request). Open response vocabulary. Preserve unknown values; never assume they mean success.

## Examples

**Response**

```json
{
  "items": [
    {
      "id": "trun_5d1f0c2e9a7b4c3d8e6f1a2b3c4d5e6f",
      "call_id": "call_01j00000000000000000000000",
      "tool_id": "tool_01j00000000000000000000000",
      "tool_name": "schedule_appointment",
      "kind": "webhook",
      "state": "failed",
      "started_at": "2026-09-25T10:01:00Z",
      "ended_at": "2026-09-25T10:01:00.842Z",
      "reason": "tool_call_failed",
      "latency_ms": 842,
      "http_status": 503,
      "arguments": {
        "date": "2026-09-22",
        "time": "10:30"
      },
      "arguments_truncated": false,
      "result": null,
      "result_truncated": false,
      "error_message": "The tool call failed.",
      "timing": "during_call"
    }
  ],
  "next_cursor": null
}
```

**SDK Code**

```python agents_listToolRuns_example
import requests

url = "https://api.rasen.ai/v1/agents/agent_id/tools/tool_id/runs"

querystring = {"start":"2026-09-01T00:00:00Z","end":"2026-09-25T00:00:00Z"}

headers = {"Authorization": "Bearer <api_key>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript agents_listToolRuns_example
const url = 'https://api.rasen.ai/v1/agents/agent_id/tools/tool_id/runs?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z';
const options = {method: 'GET', headers: {Authorization: 'Bearer <api_key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```ruby agents_listToolRuns_example
require 'uri'
require 'net/http'

url = URI("https://api.rasen.ai/v1/agents/agent_id/tools/tool_id/runs?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <api_key>'

response = http.request(request)
puts response.read_body
```

```java agents_listToolRuns_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.rasen.ai/v1/agents/agent_id/tools/tool_id/runs?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z")
  .header("Authorization", "Bearer <api_key>")
  .asString();
```

```php agents_listToolRuns_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.rasen.ai/v1/agents/agent_id/tools/tool_id/runs?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z', [
  'headers' => [
    'Authorization' => 'Bearer <api_key>',
  ],
]);

echo $response->getBody();
```

```csharp agents_listToolRuns_example
using RestSharp;

var client = new RestClient("https://api.rasen.ai/v1/agents/agent_id/tools/tool_id/runs?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <api_key>");
IRestResponse response = client.Execute(request);
```

```swift agents_listToolRuns_example
import Foundation

let headers = ["Authorization": "Bearer <api_key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.rasen.ai/v1/agents/agent_id/tools/tool_id/runs?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```