# Query traces

Tool: `veryfront__list_project_traces`

Query project traces. Requires project.logs.read.

## Arguments

| Name                | Type                                   | Required | Description                                                                                                                                                                                                                                                     |
| ------------------- | -------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `environment`       | string · min length 1 · max length 200 |          | Exact runtime environment tag, for example preview or production. Untagged telemetry is excluded.                                                                                                                                                               |
| `host`              | string · min length 1 · max length 253 |          | Exact request host (without scheme or path), for example demo.preview\.veryfront.com. Untagged telemetry is excluded.                                                                                                                                           |
| `start`             | string · date-time                     |          | Start time. ISO 8601 timestamp accepted by the Veryfront API. The backend converts it to the unix-second format required by Grafana Cloud Tempo. Traces are kept for 30 days and one search spans at most 30 days; an older start or a wider range returns 400. |
| `end`               | string · date-time                     |          | End time. ISO 8601 timestamp accepted by the Veryfront API. The backend converts it to the unix-second format required by Grafana Cloud Tempo. Traces are kept for 30 days and one search spans at most 30 days; an older start or a wider range returns 400.   |
| `limit`             | number · min 1 · max 100 · default 20  |          | Max traces to return (default: 20, max: 100).                                                                                                                                                                                                                   |
| `service`           | string · max length 200                |          | Optional OpenTelemetry service.name filter, for example veryfront-api, veryfront-studio, or veryfront-server.                                                                                                                                                   |
| `status`            | string                                 |          | Optional Tempo status filter. Use ok, error, or unset. error matches traces with an error span of the project or without project context anywhere in the trace, as trace detail reports. One of `ok`, `error`, `unset`.                                         |
| `min_duration_ms`   | number · min 0                         |          | Optional minimum trace duration in milliseconds.                                                                                                                                                                                                                |
| `run_id`            | string · min length 1 · max length 200 |          | Optional run ID. Returns traces with a span whose run.id, parent.run.id, or agent.run.id is this run, or that contain its runtime control-plane request.                                                                                                        |
| `sort_by`           | string · default timestamp             |          | Field to order the returned traces by. Defaults to timestamp; ties break by trace ID ascending. MCP and GraphQL preserve the search's newest-first nanosecond order when both sort controls are omitted. One of `timestamp`, `duration`, `status`, `service`.   |
| `sort_order`        | string · default desc                  |          | Sort direction. Defaults to desc. One of `asc`, `desc`.                                                                                                                                                                                                         |
| `project_reference` | string                                 |          | Project ID or slug                                                                                                                                                                                                                                              |

## Responses

| Status | Description                                           |
| ------ | ----------------------------------------------------- |
| 200    | The tool ran; its output is result.structuredContent. |

## Call it

```bash
curl -X POST -N "https://api.veryfront.com/mcp" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__list_project_traces",
    "arguments": {}
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"traces\":[{\"trace_id\":\"string\",\"root_span_name\":\"string\",\"root_service\":\"string\",\"started_at\":\"string\",\"duration_ms\":0,\"status\":\"ok\",\"span_count\":0,\"services\":[\"string\"],\"project_id\":\"string\",\"project_slug\":\"string\",\"environment\":\"string\",\"host\":\"string\"}],\"stats\":{\"query_time_ms\":0}}"
      }
    ],
    "structuredContent": {
      "traces": [
        {
          "trace_id": "string",
          "root_span_name": "string",
          "root_service": "string",
          "started_at": "string",
          "duration_ms": 0,
          "status": "ok",
          "span_count": 0,
          "services": [
            "string"
          ],
          "project_id": "string",
          "project_slug": "string",
          "environment": "string",
          "host": "string"
        }
      ],
      "stats": {
        "query_time_ms": 0
      }
    }
  }
}
```
