Skip to main content
Glama
wthek-mcp
by Skillnter

audit_error_handling

Audit a code snippet for common HTTP error-handling anti-patterns like manual status mutations, unhandled raw errors, and missing headersSent guards. Get a fast pattern-based diagnostic check.

Instructions

Performs a lightweight heuristic audit of a code snippet for common HTTP error handling anti-patterns (such as manual status/json mutations, unhandled raw errors, and missing headersSent guards). Note: This is a fast pattern-based diagnostic check, not a full AST compiler or AI replacement.

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": {
      "code": "<code>"
    },
    "name": "audit_error_handling"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesSource code snippet to audit for HTTP error anti-patterns

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-beta.1

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the key behavioral trait: the analysis is lightweight and heuristic/pattern-based rather than AST-accurate. It does not describe what the result looks like (findings list, severity, scoring) or how confident/complete the output is, leaving a meaningful gap for a diagnostic tool.

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, zero waste: the core purpose with examples comes first, and the scoping caveat follows. Every clause earns its place.

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?

For a single-parameter, side-effect-free diagnostic with no annotations and no output schema, the description covers purpose and limitations but says nothing about the shape or granularity of the findings returned. An agent knows what to send but not what to expect back, which is a notable gap given no output schema exists.

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?

There is a single required parameter with 100% schema description coverage, so the schema already explains 'code'. The description confirms the input is a source snippet to be audited but adds no format or size constraints beyond that, making the baseline 3 appropriate.

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 and resource ('audit of a code snippet') and names the domain precisely: HTTP error handling anti-patterns, with concrete examples (manual status/json mutations, unhandled raw errors, missing headersSent guards). It is functionally distinct from siblings like lookup_http_status or get_framework_recipe, though it never explicitly routes against them.

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 closing note gives real when-not guidance by scoping the tool as a 'fast pattern-based diagnostic check, not a full AST compiler or AI replacement,' which tells an agent not to expect deep semantic analysis. It stops short of naming an alternative tool or workflow for when this check is insufficient.

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