Skip to main content
Glama

Aggregated Codex run metrics

codex_metrics

Calculate token usage, duration, and failure counts from the local metrics log, and optionally estimate costs when pricing is set. Filter results by tool, session, cwd, or time range.

Instructions

Roll up token/duration/failure counts from the local metrics log (~/.codex-mcp/metrics.jsonl). Set CODEX_MCP_PRICING (JSON: {inputPer1M, cachedInputPer1M, outputPer1M, reasoningOutputPer1M}) to include estCostUsd.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoFilter by exact cwd.
toolNoFilter by which tool produced the run.
sinceNoISO 8601 lower bound — only entries at or after this timestamp are aggregated.
untilNoISO 8601 upper bound.
sessionIdNoFilter by session id.
Behavior4/5

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

Despite no annotations, the description clearly indicates this is a read-only operation (reads a log file) and mentions an optional environment variable for pricing. This provides useful behavioral context beyond the tool name alone.

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?

Two sentences, no wasted words. First sentence immediately states purpose and source; second adds optional behavior. Perfectly concise and front-loaded.

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

Completeness4/5

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

Covers core functionality (aggregation from log file) and optional pricing. However, with no output schema, the description could hint at the format of returned data (e.g., 'returns a JSON object with aggregated counts'). Still mostly complete for its simplicity.

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?

Schema coverage is 100% with good schema descriptions for all 5 parameters. Description adds value by mentioning the pricing env var but does not enhance parameter understanding beyond the schema. Baseline 3 is appropriate.

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?

Description clearly states it rolls up token/duration/failure counts from a specific local metrics log. This is more specific than a generic 'aggregate metrics' and gives the exact file path, distinguishing it from sibling tools that execute or review code.

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?

No guidance on when to use this tool vs alternatives like codex_sessions. Does not specify when not to use it or any prerequisites beyond optional environment variable. Missing context that would help an agent decide between sibling tools.

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/anhnguyen0905/codex-mcp'

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