Skip to main content
Glama
grandMA2 MCP
by drohi-r

get_tool_metrics

Retrieve call count, error rate, p50/p95 latency, and distinct error classes for one MCP tool over a chosen look-back window to diagnose reliability and performance issues.

Instructions

    Return latency and error-rate statistics for a single MCP tool.

    Queries the ``tool_invocations`` telemetry table for all recorded
    calls to ``tool_name`` in the last ``days`` days.

    Returns call count, error rate, p50/p95 latency in milliseconds,
    and the distinct error classes seen.  Returns ``{"calls": 0}`` if
    no invocations have been recorded yet.

    Args:
        tool_name: Exact name of the MCP tool (e.g. "list_objects").
        days: Look-back window in days (default 7).
    

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tool_name": "<tool_name>"
    },
    "name": "get_tool_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNo
tool_nameYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it names the underlying table (tool_invocations), the look-back semantics, the returned metrics, and the empty-state behavior ({"calls": 0}). It stops short of stating that it is a read-only query or any access/rate constraints, but the "Return/Queries" framing makes the read-only nature clear.

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?

Front-loaded with the purpose, then data source, return values, and edge case, with an Args block that is justified given 0% schema coverage. Docstring formatting and RST backticks add minor visual noise but no wasted sentences.

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?

A complete picture for a two-parameter read tool: source table, window, returned metrics, and the no-data case. An output schema exists so return formatting is not required, and nothing critical for a correct call is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it defines both parameters: tool_name as the exact MCP tool identifier with a concrete example, and days as the look-back window with its default of 7. Only minor gaps remain, such as whether an unknown tool_name returns zero calls or an error.

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?

States a specific verb and resource ("Return latency and error-rate statistics") and scopes it to "a single MCP tool," which separates it from aggregate telemetry tools like get_telemetry_report without needing to name them.

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 described data source and look-back window, giving an agent enough to know this is a per-tool performance lookup. There is no explicit when-to-use versus when-not guidance and no named alternative for fleet-wide or cross-tool analysis.

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

Deploy Server

Other Tools