Skip to main content
Glama

get_cost_analytics

Analyze cost data over time to track total expenses and average costs per request using customizable filters for detailed insights.

Instructions

Retrieve detailed cost analytics data over time, including total costs and averages per request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
time_of_generation_minYesStart time for the analytics period (ISO8601 format, e.g., '2024-01-01T00:00:00Z')
time_of_generation_maxYesEnd time for the analytics period (ISO8601 format, e.g., '2024-02-01T00:00:00Z')
total_units_minNoMinimum number of total tokens to filter by
total_units_maxNoMaximum number of total tokens to filter by
cost_minNoMinimum cost in cents to filter by
cost_maxNoMaximum cost in cents to filter by
prompt_token_minNoMinimum number of prompt tokens
prompt_token_maxNoMaximum number of prompt tokens
completion_token_minNoMinimum number of completion tokens
completion_token_maxNoMaximum number of completion tokens
status_codeNoFilter by specific HTTP status codes (comma-separated)
weighted_feedback_minNoMinimum weighted feedback score (-10 to 10)
weighted_feedback_maxNoMaximum weighted feedback score (-10 to 10)
virtual_keysNoFilter by specific virtual key slugs (comma-separated)
configsNoFilter by specific config slugs (comma-separated)
workspace_slugNoFilter by specific workspace
api_key_idsNoFilter by specific API key UUIDs (comma-separated)
metadataNoFilter by metadata (stringified JSON object)
ai_org_modelNoFilter by AI provider and model (comma-separated, use __ as separator)
trace_idNoFilter by trace IDs (comma-separated)
span_idNoFilter by span IDs (comma-separated)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions retrieving 'detailed cost analytics data' but doesn't specify what format the data comes in (tabular, aggregated, time-series), whether it's paginated, if there are rate limits, authentication requirements, or what 'detailed' actually means. For a complex analytics tool with 21 parameters, this is insufficient behavioral context.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a tool with a clear purpose, though it could potentially benefit from a second sentence to provide more context about usage or output format.

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

Completeness2/5

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

For a complex analytics tool with 21 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the returned data structure looks like, how results are organized, whether there are limitations on date ranges or result sizes, or how to interpret the analytics. The description leaves too many open questions for effective tool selection and invocation.

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?

The description mentions retrieving data 'over time' which aligns with the required time_of_generation parameters, and 'including total costs and averages per request' which hints at some output fields. However, with 100% schema description coverage where all 21 parameters are well-documented in the schema, the description adds minimal value beyond what's already in the structured data. The baseline of 3 is appropriate when the schema does the heavy lifting.

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?

The description clearly states the tool's purpose: 'Retrieve detailed cost analytics data over time, including total costs and averages per request.' It specifies the verb ('retrieve'), resource ('cost analytics data'), and scope ('over time'), but doesn't explicitly differentiate it from sibling analytics tools like get_error_analytics or get_latency_analytics, which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With multiple analytics tools available (get_error_analytics, get_latency_analytics, get_request_analytics, etc.), there's no indication of when cost analytics specifically is appropriate versus other analytics types, nor any prerequisites or exclusions mentioned.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/s-b-e-n-s-o-n/portkey-admin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server