# Query metrics

Tool: `veryfront__query_project_metrics`

Query project metrics. Requires project.metrics.read.

## Arguments

| Name                | Type                                                | Required | Description                                                                                                                                                                                                                                                                                                                                                        |
| ------------------- | --------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `metric`            | string · min length 1 · max length 200              | Yes      | Prometheus metric name. Raw PromQL is not accepted.                                                                                                                                                                                                                                                                                                                |
| `start`             | string · date-time                                  |          | Start time (RFC 3339). Defaults to 1 hour ago. Metrics are kept for 395 days and one query spans at most 31 days; an older start or a wider range returns 400.                                                                                                                                                                                                     |
| `end`               | string · date-time                                  |          | End time (RFC 3339). Defaults to now.                                                                                                                                                                                                                                                                                                                              |
| `step`              | string · min length 1 · max length 20 · default 60s |          | Prometheus query step, for example 60s.                                                                                                                                                                                                                                                                                                                            |
| `aggregation`       | string · default none                               |          | Aggregation to apply to the project-scoped metric selector. One of `none`, `sum`, `avg`, `min`, `max`, `count`.                                                                                                                                                                                                                                                    |
| `labels`            | object                                              |          | Optional allowlisted label filters such as environment, service\_name or status\_code. environment is the project environment on every metric: its name, matched case-insensitively, or preview for a branch. ai\_gateway\_\* metrics carry it for calls made by a project run. Unknown, platform (deployment\_environment) and project-scope labels are rejected. |
| `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__query_project_metrics",
    "arguments": {
      "metric": "string"
    }
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"series\":[{\"metric\":\"string\",\"labels\":{},\"points\":[{\"timestamp\":\"string\",\"value\":0}]}],\"stats\":{\"query_time_ms\":0}}"
      }
    ],
    "structuredContent": {
      "series": [
        {
          "metric": "string",
          "labels": {},
          "points": [
            {
              "timestamp": "string",
              "value": 0
            }
          ]
        }
      ],
      "stats": {
        "query_time_ms": 0
      }
    }
  }
}
```
