Skip to main content
Glama

rails_dependency_graph

Read-onlyIdempotent

Generates a dependency graph of Rails model associations as Mermaid or text to map architecture, trace data flow, and plan refactors.

Instructions

Generates a dependency graph showing how models connect through their associations. Output as Mermaid diagram syntax or plain text. Use when: understanding feature architecture, tracing data flow, planning refactors. Key params: model (center graph on model), depth (1-3), format (mermaid/text).

Input Schema

NameRequiredDescriptionDefault
depthNoHow many hops from the center model (1-3, default: 2)
modelNoCenter the graph on this model (e.g., 'User'). Without this, shows every model up to a cap of 50 nodes.
formatNoOutput format: mermaid (diagram syntax) or text (plain)
show_stiNoShow Single Table Inheritance hierarchies (default: false)
show_cyclesNoDetect and display circular dependency cycles (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.39.1

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile needs no restating. The description adds the output shape (Mermaid syntax vs. plain text), which matters because there is no output schema, but it never says what the graph actually includes (associations only? STI? cycles?) or what the 50-node cap does to an uncentered call.

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?

Four short sentences, front-loaded with the core capability before the usage list. The trailing 'Key params' sentence is mostly redundant with a fully described schema, which is the one piece of waste.

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?

For a read-only, zero-required-parameter analysis tool with full schema coverage, the description covers purpose, scenarios, and output format. The remaining gap is scope of the graph contents and how the default uncentered mode behaves at the 50-node cap, which the schema mentions but the description does not reinforce.

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 five parameters including show_sti and show_cycles are already documented in the schema. The 'Key params' sentence restates model/depth/format with the same meaning the schema carries, adding no syntax, constraints, or interaction rules. Baseline 3 applies.

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: generates a dependency graph of models connected through associations, with two named output formats. This clearly separates it from data-fetching siblings like rails_get_model_details or rails_get_schema. It stops short of explicitly routing against the closest sibling (rails_get_component_catalog / rails_get_schema), so it is a 4 rather than a 5.

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?

It gives an explicit 'Use when' list covering three concrete scenarios (architecture understanding, data-flow tracing, refactor planning), which is enough for an agent to decide whether to call it. There are no when-not conditions and no named alternatives, which is the only reason it is not a 5.

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