Skip to main content
Glama

rails_get_routes

Read-onlyIdempotent

Get the Rails routing table with HTTP verbs, paths, controllers and route names to build links, verify endpoints, or check helpers. Filter by controller and use summary or full detail.

Instructions

Get routing table: HTTP verbs, paths, controller#action, route names. Use when: building links/redirects, checking available endpoints, verifying route helpers exist. Filter with controller:"users", use detail:"summary" for counts or detail:"full" for route names.

Input Schema

NameRequiredDescriptionDefault
limitNoMax routes to return. Default: depends on detail level.
detailNoDetail level. summary: route counts per controller. standard: paths and actions (default). full: everything including names and constraints.
offsetNoSkip routes for pagination. Default: 0.
app_onlyNoLeave out the routes Rails' engines and gems draw on their own (Active Storage, Action Mailbox and its conductor, Turbo Native navigation, Rails' info and mailer-preview pages). Routes the app's route files declare stay, devise_for's and the health check's included. A controller filter searches every route. Default: true.
controllerNoFilter routes by controller name (e.g. 'users', 'api/v1/posts').

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.39.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds the useful behavioral detail that output shape varies by detail level (counts vs paths vs names+constraints) and that a controller filter scopes results, though it doesn't mention the app_only default filtering of engine routes — a notable behavior left entirely to the schema.

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: what it returns, when to use it, how to tune it. Front-loaded and every clause carries information; no filler or hedging.

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 correctly takes on the burden of describing the return contents (verbs, paths, controller#action, names), which it does. Pagination via limit/offset is never hinted at in the description, and the default app_only filtering — likely to surprise an agent — is only in the schema, so a small gap remains.

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 coverage is 100%, so every parameter is already documented, including the full app_only engine-route explanation. The description restates the controller filter and detail levels with pragmatic framing ("summary for counts", "full for route names") but adds little syntax or meaning the schema doesn't already carry. Baseline 3 is appropriate.

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?

Opens with a specific verb+resource ("Get routing table") and immediately enumerates the returned fields (verbs, paths, controller#action, names), which separates it cleanly from siblings like rails_get_controllers or rails_get_turbo_map. An agent knows exactly what this tool surfaces 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?

Explicit when-to-use triggers are given: building links/redirects, checking available endpoints, verifying route helpers. It also routes between modes (controller filter, summary vs full). It stops short of naming a sibling tool as the alternative when this one is wrong, so it lands at 4 rather than 5.

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