Skip to main content
Glama

get_user_stats

Read-onlyIdempotent

Retrieve per-user request and cost analytics for a specified time range. Use for individual user usage tracking, not cohort trends.

Instructions

Return per-user request and cost analytics for a required time range. This is usage-by-user, not population metrics; use get_users_analytics for active-user or cohort trends. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans.

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
status_codeNoFilter by specific HTTP status codes (comma-separated)
virtual_keysNoFilter by specific virtual key slugs (comma-separated)
page_sizeNoNumber of results per page (for pagination)

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
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint, and openWorldHint, covering safety and idempotency. The description adds value by specifying that the tool requires a time range, filters by various parameters, and has enterprise gating with a 403 error for non-enterprise. No contradictions with annotations.

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

Conciseness5/5

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

The description consists of two concise, front-loaded sentences. The first sentence states the core functionality and required time range. The second sentence adds a sibling differentiation and enterprise access note. No unnecessary words, making it highly efficient.

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

Completeness5/5

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

Given the tool's complexity (9 parameters, 2 required, detailed filtering options), the description provides essential context: the type of analytics (per-user), the required time range, and enterprise gating. The presence of an output schema further reduces the need to explain return values. The description is complete for informed usage.

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?

All 9 parameters have descriptions in the input schema (100% coverage). The description does not add additional parameter-level information beyond summarizing the purpose as 'per-user request and cost analytics' and noting required time range. With full schema coverage, the description's contribution to parameter semantics is minimal, earning a baseline score of 3.

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

Purpose5/5

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

The description clearly states the tool returns per-user request and cost analytics for a required time range. It explicitly distinguishes itself from the sibling tool get_users_analytics by stating it is 'usage-by-user, not population metrics'. This provides a specific verb-resource combination and differentiates from alternatives.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool (for per-user analytics) and when to use the alternative (get_users_analytics for population metrics). It also mentions that the tool is Enterprise-gated and returns 403 on non-Enterprise plans, informing the agent about access restrictions.

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