Skip to main content
Glama

usage_stats

Check AI usage statistics by credential, purpose, and day, including call counts, success rates, and recent failures.

Instructions

查询 AI 使用统计:按凭据、按用途、按天的调用量与成功率,以及最近失败记录。用户询问'密钥用了多少次/用在哪/用来干什么'时调用本工具。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNo只统计指定事件类型
sinceDaysNo统计最近 N 天(默认 7;0 或不传=全部历史)
credentialNo只统计指定凭据
topPurposesNo用途排行条数(默认 10)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden of explaining behavior. It communicates read-only semantics through '查询' and details what the tool returns: call volume, success rate by credential/purpose/day, and recent failure records. It does not discuss permissions or data retention, but for a non-destructive statistics query this is reasonably complete.

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 compact sentences: the first states what the tool does and its output dimensions, the second gives concrete invocation triggers. There is no filler or redundant restating of schema fields.

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, the description compensates reasonably by naming the main result dimensions and failure records. It does not specify the exact response shape or pagination, but for a statistics query with simple filter parameters this is enough for an agent to call it correctly in the stated scenarios.

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 description coverage is 100%, and the schema already documents all four parameters with types, defaults, and ranges. The description loosely maps to the parameters (credential, purpose, day) but adds no syntax or format detail beyond the schema, so the baseline 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 names a specific resource ('AI 使用统计') with a clear query verb and enumerates the breakdown dimensions: by credential, purpose, and day, plus success rate and recent failures. It also gives concrete user-phrase triggers ('密钥用了多少次/用在哪/用来干什么'), which distinguishes it from the credential-management sibling tools.

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 explicitly states when to invoke the tool: when the user asks how many times a key was used, where it was used, or what it was used for. It does not explicitly list exclusions or alternatives, but the sibling tools are all credential CRUD/management actions, so the analytics use case is already clearly differentiated.

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