Skip to main content
Glama

Agent Repair — MCP Tool Failure Diagnostics

diagnose_tool_failure

Classify a failed MCP/API tool call and recommend bounded next actions. Offline deterministic analysis. Does NOT retry, contact a service, or store the supplied error text.

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

Input Schema

NameRequiredDescriptionDefault
idempotentNoTrue ONLY when the tool call is safe to repeat without side effects.
http_statusNo
jsonrpc_codeNo
error_messageNoError or exception text; remove secrets before sharing.
retry_after_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/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 behavioral burden and does it well: it declares offline, deterministic execution and explicitly rules out retries, network contact, and storage of the supplied error text, which is exactly the safety profile an agent needs. It falls short of describing the classification taxonomy or what the recommended actions look like, so the agent cannot anticipate output.

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?

Three compact sentences, the core purpose front-loaded, then behavioral scope. No filler or redundancy.

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?

Since all five parameters are optional, an agent could invoke this with an empty object, and the description never says what happens then or which inputs actually drive a useful classification. The absence of an output schema makes the vague 'recommend bounded next actions' phrasing a real gap. The behavioral scope is complete, but the input and output picture is not.

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

Parameters2/5

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

Five parameters with only 40% schema description coverage, yet the description mentions none of them: idempotent, http_status, jsonrpc_code, and retry_after_seconds get no explanation of how they influence the classification. With low coverage the description was required to compensate and does not.

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?

The description names a specific verb and resource: 'Classify a failed MCP/API tool call and recommend bounded next actions.' That is far more concrete than a tautology and implies the distinction from validate_tool_arguments. It stops short of explicitly positioning itself against the named siblings.

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?

The implied trigger is clear: call this after a tool call has already failed. The 'Does NOT retry, contact a service, or store' sentence sets negative boundaries, which is useful. However, there is no explicit statement of when to use this versus validate_tool_arguments, nor any prerequisites.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources