> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Query metrics

> Query project metrics.

`veryfront__query_project_metrics`

Requires project.metrics.read.

## Access

No external-service connection is required. Use a Veryfront credential with access to the requested resources.

**Call type:** Read-only.

## Arguments

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `metric` | `string` | Yes | Prometheus metric name. Raw PromQL is not accepted. Minimum length: `1`. Maximum length: `200`. |
| `start` | `string` | No | 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. Format: `date-time`. |
| `end` | `string` | No | End time (RFC 3339). Defaults to now. Format: `date-time`. |
| `step` | `string` | No | Prometheus query step, for example 60s. Default: `"60s"`. Minimum length: `1`. Maximum length: `20`. |
| `aggregation` | `string` | No | Aggregation to apply to the project-scoped metric selector. Default: `"none"`. Values: `"none"`, `"sum"`, `"avg"`, `"min"`, `"max"`, `"count"`. |
| `labels` | `object` | No | 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` | No | Project ID or slug |

## Example request

Send this JSON-RPC request through an initialized MCP client. Replace sample identifiers and values before calling the tool. See [MCP client setup](https://veryfront.com/docs/cloud/getting-started/connect-mcp.md).

```json title="request.json" theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__query_project_metrics",
    "arguments": {
      "metric": "example"
    }
  }
}
```

## Result

The published output shape is summarized below. Inspect both the MCP response content and `isError` when handling a call.

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `series` | `object[]` | Yes | List of series associated with this tool result. |
| `stats` | `object` | Yes | Structured stats details associated with this tool result. |

## Full schemas

```json title="input-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "metric": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Prometheus metric name. Raw PromQL is not accepted."
    },
    "start": {
      "type": "string",
      "format": "date-time",
      "description": "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": {
      "type": "string",
      "format": "date-time",
      "description": "End time (RFC 3339). Defaults to now."
    },
    "step": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20,
      "description": "Prometheus query step, for example 60s.",
      "default": "60s"
    },
    "aggregation": {
      "type": "string",
      "enum": [
        "none",
        "sum",
        "avg",
        "min",
        "max",
        "count"
      ],
      "description": "Aggregation to apply to the project-scoped metric selector.",
      "default": "none"
    },
    "labels": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "description": "Additional structured values supplied to the tool."
      },
      "description": "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": {
      "type": "string",
      "description": "Project ID or slug"
    }
  },
  "required": [
    "metric"
  ],
  "additionalProperties": false,
  "description": "Use after logs or traces for counters, rates, latency buckets, usage, or runtime health metrics. The API injects project scope; raw PromQL is not accepted. The result is never partial: more than 100 series, a series with more than 11,000 points or a result over 8 MiB is refused, so add a label filter, choose an aggregation, or use a coarser step or a shorter range.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

```json title="output-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "series": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "metric": {
            "type": "string"
          },
          "labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "description": "Additional structured values associated with this result."
            },
            "description": "Structured labels details associated with this tool result."
          },
          "points": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "timestamp": {
                  "type": "string"
                },
                "value": {
                  "type": "number"
                }
              },
              "required": [
                "timestamp",
                "value"
              ],
              "additionalProperties": false
            },
            "description": "List of points associated with this tool result."
          }
        },
        "required": [
          "metric",
          "labels",
          "points"
        ],
        "additionalProperties": false
      },
      "description": "List of series associated with this tool result."
    },
    "stats": {
      "type": "object",
      "properties": {
        "query_time_ms": {
          "type": "number"
        }
      },
      "required": [
        "query_time_ms"
      ],
      "additionalProperties": false,
      "description": "Structured stats details associated with this tool result."
    }
  },
  "required": [
    "series",
    "stats"
  ],
  "additionalProperties": false,
  "description": "Structured result returned by the query_project_metrics tool.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

<details>
  <summary>Try this tool</summary>

  Replace sample arguments with values for your project or connected account. Calls run only when you select Run tool.

  MCP tool call

  Call `veryfront__query_project_metrics` against the Veryfront MCP endpoint.

  Bearer token or API key

  Arguments (JSON)

  Run tool

  Output JSON

  <pre />
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.