Skip to main content
Glama

Get Token Efficiency & Audit Metrics

get_token_metrics
Read-onlyIdempotent

Query token savings and budgeting statistics plus recent audit logs from the global memory database, using a configurable time window and log limit.

Instructions

Query machine-wide token savings, budgeting statistics, and audit logs from ~/.ag-memory-mcp/global.db.

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": "get_token_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum recent audit logs to retrieve
timeframe_hoursNoTime window in hours (default 24)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.2.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely useful scope information beyond that — machine-wide, global database at ~/.ag-memory-mcp/global.db — which clarifies the aggregation boundary. It says nothing about cost, latency, payload size, or what the audit log entries contain.

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?

One sentence, front-loaded with the verb and the resource categories, ending with the data source. Nothing is padded and nothing in it is redundant.

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?

For a two-optional-parameter read-only metrics tool with full annotation coverage and no output schema, the definition tells the agent what data exists and where it lives. Minor residual gap: it does not indicate whether the three result categories are always returned together or how recent audit logs relate to the timeframe window.

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%, and both parameters (limit, timeframe_hours) are fully described with defaults, minimums and maximums, so the schema carries the burden. The description adds no parameter-level meaning such as whether timeframe_hours applies to audit logs only or to all three metric categories.

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?

States a specific verb (Query) and specific resources (token savings, budgeting statistics, audit logs) plus the exact data source path. An agent knows exactly what it gets back conceptually. It stops short of naming or contrasting a sibling tool, which is the only thing keeping it from a 5.

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?

There is no explicit when-to-use or when-not-to-use guidance, and no alternative named. The machine-wide/global scope is stated, which weakly implies it is the place to go for cross-project metrics rather than project memory lookups, but that inference is left entirely to the agent.

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