Get stacked error-series data grouped by HTTP status code over time, with summary and per-code series. Use this to see which error classes dominate; use get_error_status_codes_analytics for distinct-code distribution instead. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans.
AI agents call get_error_stacks_analytics to retrieve information from Portkey Admin without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
configs | string | — | Legacy Portkey query param for config slugs. Comma-separated string; prefer config_slugs for structured inputs. |
span_id | string | — | Legacy Portkey query param for span IDs. Comma-separated string; prefer span_ids for structured inputs. |
cost_max | number | — | Maximum cost in cents to filter by |
cost_min | number | — | Minimum cost in cents to filter by |
metadata | string | — | Legacy Portkey query param for metadata filtering. Stringified JSON object, e.g. '{"env":"prod","app":"myapp"}'; prefer metadata_filter for structured inputs. |
span_ids | array | — | Structured alias for span_id. Use an array of span IDs; normalized to the legacy comma-separated Portkey query param. |
trace_id | string | — | Legacy Portkey query param for trace IDs. Comma-separated string; prefer trace_ids for structured inputs. |
trace_ids | array | — | Structured alias for trace_id. Use an array of trace IDs; normalized to the legacy comma-separated Portkey query param. |
api_key_ids | string | — | Legacy Portkey query param for API key UUIDs. Comma-separated string; request_analytics also accepts an array and normalizes it to this form. |
prompt_slug | string | — | Filter by prompt slug |
status_code | string | — | Legacy Portkey query param for HTTP status codes. Comma-separated string; prefer status_codes for structured inputs. |
ai_org_model | string | — | Legacy Portkey query param for provider/model pairs. Format: 'provider__model' with double underscore, e.g. 'openai__gpt-4' or 'anthropic__claude-3-opus'. Comma |
Parameters from the server's own tool schema.
Even though get_error_stacks_analytics only reads data, uncontrolled read access leaks sensitive information and racks up API costs — an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Risk signalsHigh parameter count (29 properties)
Attacks that exploit this kind of access
Get stacked error-series data grouped by HTTP status code over time, with summary and per-code series. Use this to see which error classes dominate; use get_error_status_codes_analytics for distinct-code distribution instead. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans. It is categorised as a Read tool in the Portkey Admin MCP Server, which means it retrieves data without modifying state.
get_error_stacks_analytics accepts 12 parameters: configs, span_id, cost_max, cost_min, metadata, span_ids, trace_id, trace_ids, api_key_ids, prompt_slug, status_code, ai_org_model. The full parameter table on this page comes from the server's own tool schema.
Register the Portkey Admin MCP server in PolicyLayer and add a rule for get_error_stacks_analytics: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Portkey Admin. Nothing to install.
get_error_stacks_analytics is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the get_error_stacks_analytics rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for get_error_stacks_analytics. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
get_error_stacks_analytics is provided by the Portkey Admin MCP server (CodesWhat/portkey-admin-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.