Skip to main content
Glama

tokmeter_git_cost

Read-only

Attribute AI coding token usage, cost, cache hits, subagent spend, and compaction tax to Git branches or PR windows by commit timestamps and repository directory matching.

Instructions

Attribute AI coding token usage, cost, cache hit share, subagent spend, and compaction tax to a git branch or PR window based on commit timestamps and repository directory matching.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "tokmeter_git_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
dirNoRepository directory (defaults to process cwd)
baseNoBase branch or git ref to compare HEAD against (auto-detected if omitted)
formatNotext
lead_minutesNoMinutes before the earliest branch commit to include pre-commit turns
since_commitNoExplicit base commit/ref instead of merge-base auto-detection

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.27.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuinely non-obvious behavioral context: attribution is derived from commit timestamps and directory matching, which tells the agent how results are computed and why a branch with no commits yields nothing. It stops short of describing output shape, performance, or what happens when auto-detection fails.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One tightly packed sentence with the verb and scope front-loaded and no filler. Dense jargon such as 'compaction tax' and 'subagent spend' is left undefined, which slightly reduces immediate comprehension but does not waste space.

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?

With five params, 80% schema coverage, and read-only annotations, the call mechanics are adequately covered. But there is no output schema, and the description never indicates what the attribution result looks like (per-branch summary, per-commit breakdown, aggregates), which is the main remaining gap for a reporting tool.

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 80%, so the baseline is 3. The description reinforces the meaning of the directory-matching and commit-timestamp parameters but adds no format or interpretation detail beyond what the property descriptions already state for dir, base, since_commit, lead_minutes, and format.

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?

Names a specific verb (attribute) and a precise set of resources (token usage, cost, cache hit share, subagent spend, compaction tax) scoped to a git branch or PR window. The attribution basis (commit timestamps plus repository directory matching) makes it clearly distinct from sibling reporting tools like tokmeter_projects or tokmeter_search.

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?

Usage is implied by the branch/PR-window framing, so an agent can infer this is the tool for per-branch cost attribution. However, there is no explicit when-to-use versus alternatives guidance and no stated prerequisites (must be inside a git repo, uncommitted work excluded, etc.).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.