Skip to main content
Glama
dlaporte

openai-usage-mcp

by dlaporte

costs

Get total OpenAI spend, daily breakdowns, and month-end forecasts for any date range. Group data by project or line item and identify anomalies.

Instructions

Query OpenAI dollar-amount spend data.

USE THIS TOOL FOR:

  • Total spend over a date range (summary mode, default)

  • Daily cost breakdown by line item or project

  • Month-to-date spend with projected month-end forecast

  • Identifying cost anomalies (spike days highlighted in summary)

DO NOT USE THIS TOOL FOR:

  • Token or request counts (use 'usage' tool instead)

  • Comparing two different months side by side (use 'cost-comparison' tool)

DETAIL LEVELS:

  • summary (default): Compact total + top-N breakdown table (~20 lines). Includes projected month-end spend and anomaly detection when applicable.

  • daily: Per-day breakdown with per-item amounts.

  • raw: Full unprocessed data, every line item every day.

DEFAULTS: detail_level='summary', group_by='line_item', top_n=10, end_time=today

EXAMPLES:

  • This month's spend: start_time="2026-03-01"

  • Last 7 days by project: start_time="2026-03-23", group_by="project_id"

  • Daily breakdown for February: start_time="2026-02-01", end_time="2026-03-01", detail_level="daily"

Dates in YYYY-MM-DD format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNo
end_timeNo
group_byNo
start_timeYes
detail_levelNosummary

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries full transparency burden. It discloses detail levels with output characteristics (e.g., 'Compact total + top-N breakdown table (~20 lines)'), default parameter values, anomaly detection behavior, and date formatting requirements. It does not mention error handling or access permissions, but for a read-only query tool the disclosed behavioral traits are substantial.

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 is well-structured with bolded section headers, uses imperative bullet lists, and packs information efficiently into about one screen. No filler—every section addresses a distinct concern (purpose, usage, detail levels, defaults, examples, date format).

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?

The tool has a moderate complexity level with 5 parameters and an output schema. The description covers use cases, alternatives, detail-level semantics, defaults, and examples, which is sufficient for an agent to select and invoke correctly. The presence of an output schema offsets the need to enumerate return fields, and the examples give concrete invocation patterns.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It resolves ambiguity by specifying defaults for all optional parameters (detail_level, group_by, top_n, end_time) and providing concrete examples that illustrate parameter use. The statement that 'summary (default)' and 'top-N' clarify top_n's role. The allowed group_by values are only partially specified (line_item and project_id), but examples cover typical usage.

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 opens with 'Query OpenAI dollar-amount spend data,' clearly identifying the verb and resource. It distinguishes from siblings by explicitly naming the 'usage' and 'cost-comparison' tools in the DO NOT USE section, making its purpose unmistakable.

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 has dedicated 'USE THIS TOOL FOR' and 'DO NOT USE THIS TOOL FOR' sections. It lists specific use cases (total spend, daily breakdown, month-to-date forecast, anomaly detection) and explicitly directs users to alternative tools for token counts and month-over-month comparison, satisfying both when and when-not guidance.

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/dlaporte/openai-usage-mcp'

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