Skip to main content
Glama

Aggregated Codex run metrics

codex_metrics

Aggregate token, duration, and failure counts from the local metrics log. Optionally include estimated cost by setting CODEX_MCP_PRICING.

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?

With no annotations, the description carries full burden. It discloses the data source (~/.codex-mcp/metrics.jsonl) and an optional env variable to include cost estimates. It implies read-only aggregation, but does not explicitly state non-destructiveness. Overall, good transparency for a read-like tool.

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 two sentences, front-loaded with the key action 'Roll up', and no unnecessary words. Every sentence provides essential information: what it does and how to include cost.

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

Completeness3/5

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

The description explains the input parameters and optional env variable but does not describe the output format or structure. For a metrics tool, the agent may need to know what fields are returned (e.g., total tokens, duration, failure count). This omission reduces completeness.

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 coverage is 100% with per-parameter descriptions. The description adds significant meaning beyond schema by explaining the overall aggregation context and the CODEX_MCP_PRICING env variable for cost estimation, which is not in the 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 it aggregates token, duration, and failure counts from a local metrics log. The verb 'Roll up' is specific to aggregation, and the resource 'metrics log' is precisely identified with a file path. Among siblings, this is distinct as the only metrics rollup tool.

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

Usage Guidelines3/5

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

The description implies usage when aggregated metrics are needed but does not explicitly state when to use this tool versus alternatives like codex_execute or codex_sessions. No exclusions or contextual cues are provided.

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