Skip to main content
Glama

rails_get_context

Read-onlyIdempotent

Get cross-layer context for a Rails controller action or model in one call, combining schema, routes, controller, views, Stimulus, and tests.

Instructions

Get cross-layer context in a single call - combines schema, model, controller, routes, views, stimulus, and tests. Use when: you need full context for implementing a feature or modifying an action. Specify controller:"PostsController" action:"create" to get everything for that action in one call.

Input Schema

NameRequiredDescriptionDefault
modelNoModel name (e.g. 'Post'). Returns schema, associations, validations, scopes, callbacks, tests.
actionNoSpecific action name (e.g. 'create'). Requires controller. Returns full action context.
featureNoFeature keyword (e.g. 'post'). Like analyze_feature but includes schema columns and scope bodies.
includeNoAdditional context to bundle: 'stimulus', 'turbo', 'services', 'jobs', 'conventions', 'helpers', 'env', 'callbacks', 'tests', 'config', 'gems', 'security'. Appends these to any mode.
controllerNoController name (e.g. 'PostsController'). Returns action source, filters, strong params, routes, views.

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=true, idempotentHint=true, destructiveHint=false and closed-world scope, so safety is fully covered. The description adds aggregation behavior (one call returns multiple layers) but says nothing about output size, latency, or truncation risk on a tool that reads many layers at once.

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 short sentences with the capability stated first, then the trigger condition, then a usage example. The example sentence partially duplicates the trigger sentence, a minor redundancy that keeps it off a 5.

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?

With five optional parameters, no required parameters, and no output schema, the description should clarify whether model, feature, and controller/action are mutually exclusive or composable modes — the schema hints at modes but the description never resolves it. It also omits any expectation about response size for a cross-layer read.

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 the 'include' bundle list is already documented with examples. The description only restates the controller+action pairing already stated in the action parameter description, adding no combination semantics or precedence rules.

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?

Names a specific verb and resource ('Get cross-layer context') and enumerates exactly which layers are bundled (schema, model, controller, routes, views, stimulus, tests), which a granular sibling like rails_get_model_details cannot claim. It does not explicitly name a sibling it replaces, so it stops short of 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?

Provides an explicit trigger ('Use when: you need full context for implementing a feature or modifying an action') plus a concrete invocation example, controller:"PostsController" action:"create". It lacks explicit when-not guidance or routing to the narrower siblings when only one layer is needed.

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