Skip to main content
Glama

rails_get_controllers

Read-onlyIdempotent

Retrieve controller actions, before_action filters, strong params, and parent classes to inspect or modify Rails controllers. Drill into a specific action to read its source code with line numbers.

Instructions

Get controller details: actions, before_action filters, strong params, and parent class. Use when: adding/modifying controller actions, checking what filters apply, or reading action source code. Filter with controller:"PostsController", drill into action:"create" for source code with line numbers.

Input Schema

NameRequiredDescriptionDefault
limitNoMax controllers to return when listing. Default: 50.
actionNoSpecific action name (e.g. 'index', 'create'). Requires controller. Returns the action source code and applicable filters.
detailNoDetail level for controller listing. summary: names + action counts. standard: names + action list (default). full: everything. Ignored when specific controller is given.
offsetNoSkip this many controllers for pagination. Default: 0.
controllerNoOptional: specific controller name (e.g. 'PostsController'). Omit for all controllers.

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, idempotentHint, and non-destructive, so the safety profile is covered. The description adds behavior beyond that: results are paginated list-style by default, narrowing to a single controller returns full detail, and drilling into an action returns source code with line numbers plus the filters that apply to it.

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?

Three tight sentences: purpose first, usage next, invocation pattern last. No filler or restated title. The final sentence packs filter and drill-down into one line, which is dense but still readable.

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?

There is no output schema, so the description usefully names the return contents (actions, filters, strong params, parent class, source with line numbers). Pagination defaults and the detail enum are handled in the schema. What remains thin is the shape of the response when listing all controllers versus one, but an agent has enough to call it correctly.

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 every parameter including limit, offset, detail, controller, and action is already documented at the field level. The description's 'controller:"PostsController"' and 'action:"create"' examples largely restate the schema's own examples, adding little that is not already structured. Baseline 3 applies when the schema carries the parameter burden.

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?

The description uses a specific verb and resource ('Get controller details') and immediately enumerates what comes back: actions, before_action filters, strong params, parent class. That set of returned fields makes it plainly distinguishable from siblings like rails_get_view, rails_get_routes, or rails_get_model_details without opening the schema.

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:' with three concrete scenarios (adding/modifying actions, checking filters, reading action source) and explains the controller: filter and action: drill-down pattern. It stops short of naming alternatives or exclusions – e.g. when to prefer rails_search_code or rails_get_callbacks instead – so it is clear but not fully routing.

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