Skip to main content
Glama

rails_get_schema

Read-onlyIdempotent

Retrieve database schema details—tables, columns, types, indexes, and foreign keys—to write migrations and verify constraints or table relationships. Filter by table and detail level.

Instructions

Get database schema: tables, columns, types, indexes, foreign keys. Use when: writing migrations, checking column types/constraints, understanding table relationships. Filter to one table with table:"users", control detail with detail:"summary"|"standard"|"full".

Input Schema

NameRequiredDescriptionDefault
limitNoMax tables to return when listing. Default: 50 for summary, 25 for standard, 10 for full.
tableNoSpecific table name for full detail. Omit for overview.
detailNoDetail level. summary: table names + column counts. standard: table names + column names/types (default). full: everything including indexes, FKs, comments.
formatNoOutput format. Default: markdown.
offsetNoSkip this many tables for pagination. Default: 0.

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 and destructiveHint=false, so the safety profile is fully covered by structured data. The description adds nothing beyond that — no pagination behavior, no note on cost of "full" detail across large schemas — so it earns only the baseline.

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 compact sentences, front-loaded with the resource then the use cases then the knobs. Slight redundancy with schema-provided enum values keeps it from a 5, but every sentence carries weight.

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 does the necessary work of enumerating the return contents (tables, columns, types, indexes, FKs) and differentiating the detail levels. Pagination and limit defaults live in the schema, so nothing critical is missing for correct invocation.

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 the enum values, defaults and limit semantics are already documented in the schema. The description's `table:"users"` and `detail:"summary"|"standard"|"full"` examples restate those values rather than adding new meaning; 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?

Opens with a specific verb and enumerated resource: "Get database schema: tables, columns, types, indexes, foreign keys." That clearly distinguishes it from siblings like rails_get_model_details or rails_get_config, though it never names an alternative explicitly.

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 gives three concrete scenarios (writing migrations, checking column types/constraints, understanding relationships), which is more than most siblings offer. It lacks explicit when-not-to-use or named alternatives, so it falls short of a 5.

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