Skip to main content
Glama

rails_get_view

Read-onlyIdempotent

Retrieve Rails view templates, partials, and their Stimulus/partial references by controller or exact path to inspect ERB content before editing.

Instructions

Get view templates, partials, and their Stimulus/partial references. Use when: editing ERB views, checking which partials a page renders, or finding Stimulus controller usage. Filter with controller:"posts" for all views, or path:"posts/index.html.erb" for one file's content.

Input Schema

NameRequiredDescriptionDefault
pathNoSpecific view path relative to app/views (e.g. 'posts/index.html.erb'). Returns full content.
detailNoDetail level. summary: file list with line counts. standard: file list with partials/stimulus refs (default). full: template content.
controllerNoFilter views by controller name (e.g. 'posts', 'comments'). Lists all templates for that controller.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.39.1

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior, so the safety profile is covered. The description adds that a path lookup returns full file content versus a controller filter listing all views, but says nothing about output size, pagination, or what happens when no filter is supplied.

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?

Two tight sentences: the capability statement is front-loaded, then the usage triggers, then the filtering syntax. Nothing extraneous, and the most decision-relevant information comes first.

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 adequately conveys the return shape by distinguishing a file list from full file content. It is nearly complete for a read-only lookup tool, though it never states the default behavior when both filters are omitted.

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% and each parameter already carries its own description and examples, so the schema does the heavy lifting. The description's inline examples (controller:"posts", path:"posts/index.html.erb") echo the schema rather than adding new semantics, so the baseline 3 applies.

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 ('Get view templates, partials, and their Stimulus/partial references') and implicitly scopes it against siblings like rails_get_stimulus and rails_get_partial_interface by focusing on view files. An agent can tell what it retrieves 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?

The 'Use when:' clause names three concrete scenarios (editing ERB views, checking rendered partials, finding Stimulus controller usage), which is clear routing guidance. It stops short of naming alternative sibling tools or stating when not to use it (e.g. use rails_get_stimulus for controller source).

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