Skip to main content
Glama

rails_diagnose

Read-only

Diagnose Rails errors in one call: parse and classify the exception, gather controller/model/schema context, inspect recent git changes and logs, then suggest a fix.

Instructions

One-call error diagnosis: parses the error, classifies it, gathers controller/model/schema context, shows recent git changes, pulls relevant logs, and suggests a fix. Use when: you hit an error and need to understand why. Key params: error (required - paste the error message), file, line, action (controller#action).

Input Schema

NameRequiredDescriptionDefault
fileNoFile where error occurs, relative to Rails root (e.g. 'app/controllers/posts_controller.rb').
lineNoLine number where the error occurs.
errorYesError message or exception (e.g. 'NoMethodError: undefined method `foo` for nil:NilClass').
actionNoController#action format (e.g. 'posts#create'). Pulls full action context.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.39.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, so the safety profile is covered. The description adds real behavioral context by disclosing the composite pipeline (context gathering, git history, log pulling, fix suggestion) that an agent would not infer from the name alone. It omits cost/latency implications of a multi-source call, keeping it from a 5.

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 core capability, then usage condition, then params — a sensible order with no filler. The 'Key params' sentence is somewhat redundant with the fully documented schema, slightly diluting conciseness.

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?

With no output schema, the description compensates by indicating what comes back: parsed/classified error, controller/model/schema context, git changes, logs, and a suggested fix. That is sufficient for an agent to know what to expect, though it doesn't describe output shape or size.

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%, so all four parameters are already documented with examples in the schema. The description only restates the key params and marks error as required, adding the minor hint to 'paste the error message' but no format or interaction details beyond the schema.

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 ('One-call error diagnosis') and enumerates the concrete sub-actions it performs: parsing, classifying, gathering controller/model/schema context, git changes, logs, and a suggested fix. This clearly separates it from single-purpose siblings like rails_read_logs or rails_get_context.

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?

'Use when: you hit an error and need to understand why' gives a clear triggering condition. It does not name alternatives or exclusions (e.g., when to prefer rails_read_logs or rails_get_context directly), so it stops short of a 5.

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