Skip to main content
Glama

ai_metrics

Retrieve accumulated AI metrics including cache hit rate, token usage, and error counts to monitor performance after AI inferences.

Instructions

返回进程内累积的 AI 调用指标 (Prompt Caching 命中率、token 消耗、错误次数)。对应 P4.4: ai.cache_hit_rate / ai.tokens_saved_via_cache 等。可在每次 ai_infer_business_names 等工具调用后查询。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resetNo查询后是否重置计数 (默认 false)
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses the metrics returned and the reset parameter. It implies read-only behavior but does not explicitly state idempotency or side effects. Adequate but could be more thorough.

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 repetition, front-loaded with purpose. Every word earns its place. Highly concise.

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?

Given no output schema and a simple parameter, the description is sufficient for understanding what the tool does. It mentions specific metrics and usage context. However, it could improve by describing the output format (e.g., JSON structure).

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% (one boolean param with description). The description adds minimal extra meaning beyond the schema, only clarifying that reset controls whether to reset counts after query. Baseline of 3 is appropriate.

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 the tool returns accumulated AI call metrics (cache hit rate, token consumption, error counts) and references specific metric keys. It distinguishes itself from sibling tools which are about codegen, database, or server health, not metrics.

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

Usage Guidelines4/5

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

The description suggests querying after other AI tool calls like ai_infer_business_names, providing clear context. It does not explicitly state when not to use it or list alternatives, but the intended use is clear.

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/ZhaoXingPeng/DBJavaGenix'

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