Aggregated Codex run metrics
codex_metricsAggregate 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
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Filter by exact cwd. | |
| tool | No | Filter by which tool produced the run. | |
| since | No | ISO 8601 lower bound — only entries at or after this timestamp are aggregated. | |
| until | No | ISO 8601 upper bound. | |
| sessionId | No | Filter by session id. |