Skip to main content
Glama
dlaporte

openai-usage-mcp

by dlaporte

cost-comparison

Compare OpenAI spending between two calendar months to identify cost changes. Get total spend, per-line-item deltas, and biggest movers.

Instructions

Compare OpenAI costs between two months to identify spending changes.

USE THIS TOOL FOR:

  • Month-over-month cost variance analysis (e.g., February vs March)

  • Identifying which line items increased or decreased the most

  • Executive-level cost change summaries

DO NOT USE THIS TOOL FOR:

  • Single-month cost analysis (use 'costs' tool instead)

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

  • Arbitrary date range comparisons (this tool compares full calendar months only)

PARAMETERS:

  • baseline_month: Earlier month in YYYY-MM format (e.g., "2026-02")

  • comparison_month: Later month in YYYY-MM format (e.g., "2026-03")

  • group_by: "line_item" (default), "project_id", or both

  • top_n: Number of items to show (default 10)

OUTPUT includes:

  • Total spend for each month with overall delta and % change

  • Per-line-item comparison table with delta and % change

  • Biggest movers section highlighting largest increase and decrease

EXAMPLES:

  • February vs March: baseline_month="2026-02", comparison_month="2026-03"

  • By project: baseline_month="2026-02", comparison_month="2026-03", group_by="project_id"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNo
group_byNo
baseline_monthYes
comparison_monthYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It transparently explains what the tool returns (total spend, per-line-item comparison, biggest movers), the constraint that it compares full calendar months, and includes examples. This is comprehensive behavioral coverage.

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 appropriately sized for a tool with 4 parameters and multiple usage scenarios. It is well-structured with clear sections (USE, DO NOT USE, PARAMETERS, OUTPUT, EXAMPLES), front-loaded with the main purpose, and every section earns its place without redundancy.

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 4 parameters, no schema descriptions, and no annotations, but the description compensates fully. It includes parameter details, output structure, examples, and distinctions from sibling tools. This is a complete and self-sufficient description for an agent.

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

Parameters5/5

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

The schema description coverage is 0%, so the description must compensate. It does so thoroughly by explaining each parameter's format (YYYY-MM), default values, allowed options for group_by ('line_item', 'project_id', or both), and top_n semantics. The description adds substantial meaning beyond the bare schema.

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's purpose: 'Compare OpenAI costs between two months to identify spending changes.' It uses a specific verb and resource, and explicitly distinguishes itself from sibling tools 'costs' and 'usage' by naming them in the DO NOT USE section.

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 USE THIS TOOL FOR and DO NOT USE THIS TOOL FOR sections, including specific alternative tools ('costs' for single-month analysis, 'usage' for token/request data). This gives clear when-to-use and when-not-to-use 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