Skip to main content
Glama

get_analytics_group_providers

Read-onlyIdempotent

Fetch provider-grouped analytics for a workspace and time range with selectable metrics, ordering, and pagination; compare provider traffic or reliability. Enterprise-gated.

Instructions

Enterprise-gated. Get provider-grouped analytics for one workspace and time range with selectable metrics, ordering, pagination, and optional total count. Use this when comparing provider traffic or reliability; requested metric fields are preserved in each provider row. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnsNoProvider metrics to include in each grouped row
configsNoLegacy Portkey query param for config slugs. Comma-separated string; prefer config_slugs for structured inputs.
span_idNoLegacy Portkey query param for span IDs. Comma-separated string; prefer span_ids for structured inputs.
cost_maxNoMaximum cost in cents to filter by
cost_minNoMinimum cost in cents to filter by
metadataNoLegacy Portkey query param for metadata filtering. Stringified JSON object, e.g. '{"env":"prod","app":"myapp"}'; prefer metadata_filter for structured inputs.
order_byNoMetric or field used to order groups
span_idsNoStructured alias for span_id. Use an array of span IDs; normalized to the legacy comma-separated Portkey query param.
trace_idNoLegacy Portkey query param for trace IDs. Comma-separated string; prefer trace_ids for structured inputs.
page_sizeNoNumber of provider groups per page
trace_idsNoStructured alias for trace_id. Use an array of trace IDs; normalized to the legacy comma-separated Portkey query param.
api_key_idsNoLegacy Portkey query param for API key UUIDs. Comma-separated string; request_analytics also accepts an array and normalizes it to this form.
prompt_slugNoFilter by prompt slug
status_codeNoLegacy Portkey query param for HTTP status codes. Comma-separated string; prefer status_codes for structured inputs.
ai_org_modelNoLegacy Portkey query param for provider/model pairs. Format: 'provider__model' with double underscore, e.g. 'openai__gpt-4' or 'anthropic__claude-3-opus'. Comma-separated string; prefer provider_models for structured inputs.
config_slugsNoStructured alias for configs. Use an array of config slugs; normalized to the legacy comma-separated Portkey query param.
current_pageNoZero-based result page
status_codesNoStructured alias for status_code. Use an array of HTTP status codes; normalized to the legacy comma-separated Portkey query param.
virtual_keysNoLegacy Portkey query param for virtual key slugs. Comma-separated string; prefer virtual_key_slugs for structured inputs.
deployment_idNoComma-separated list of deployment IDs (UUIDs) to filter by. Prefer deployment_ids for structured inputs.
include_totalNoRequest the total provider-group count
order_by_typeNoSort direction accepted by Portkey, such as asc or desc
deployment_idsNoStructured alias for deployment_id. Use an array of deployment UUIDs; normalized to the comma-separated Portkey query param.
workspace_slugYesWorkspace slug to analyze
metadata_filterNoStructured alias for metadata. Use an object such as { env: 'prod' }; normalized to a JSON string before the request is sent.
provider_modelsNoStructured alias for ai_org_model. Use provider__model strings in an array; normalized to the legacy comma-separated Portkey query param.
total_units_maxNoMaximum number of total tokens to filter by
total_units_minNoMinimum number of total tokens to filter by
prompt_token_maxNoMaximum number of prompt tokens
prompt_token_minNoMinimum number of prompt tokens
virtual_key_slugsNoStructured alias for virtual_keys. Use an array of virtual key slugs; normalized to the legacy comma-separated Portkey query param.
completion_token_maxNoMaximum number of completion tokens
completion_token_minNoMinimum number of completion tokens
weighted_feedback_maxNoMaximum weighted feedback score (-10 to 10)
weighted_feedback_minNoMinimum weighted feedback score (-10 to 10)
time_of_generation_maxYesEnd time for the analytics period (ISO8601 format, e.g., '2024-02-01T00:00:00Z')
time_of_generation_minYesStart time for the analytics period (ISO8601 format, e.g., '2024-01-01T00:00:00Z')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.13.0
    • addedInput schema / properties / deployment_id
      Added value: +{
      +  "description": "Comma-separated list of deployment IDs (UUIDs) to filter by. Prefer deployment_ids for structured inputs.",
      +  "type": "string"
      +}
    • addedInput schema / properties / deployment_ids
      Added value: +{
      +  "description": "Structured alias for deployment_id. Use an array of deployment UUIDs; normalized to the comma-separated Portkey query param.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Addedv0.11.5

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive safety. The description adds materially useful behavior annotations already don't cover: Enterprise gating, a 403 response on non-Enterprise plans, and the guarantee that requested metric fields are preserved per provider row.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core scope statement is front-loaded and efficient, but 'Enterprise-gated' is stated twice (opening and closing sentence), and the trailing 403 detail duplicates the same gating context. Mild redundancy without losing comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return-value description is unnecessary. The description covers scope, gating/auth failure mode, and grouping dimension, which is sufficient for correct invocation; it omits sorting/page-bound interaction detail, which is minor.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema documents all 37 params including the legacy-vs-structured alias pairs. The description only summarizes capabilities (metrics, ordering, pagination, total count) and adds no syntax or field-level meaning beyond the schema, which is the baseline-3 case.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Get provider-grouped analytics') with scope constraints (one workspace, time range) and capabilities (metrics, ordering, pagination, total count). It is clearly distinguishable from siblings like get_analytics_group_users/models, though it never names them explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Use this when comparing provider traffic or reliability' gives a concrete selection context. No when-not guidance or named alternatives are offered, so it stops short of explicit routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools