Skip to main content
Glama

rails_migration_advisor

Read-onlyIdempotent

Generate Rails migration code for schema changes like add_column, rename_column, and add_index. Flags irreversible operations and shows affected models so you can plan database changes safely.

Instructions

Generates migration code for schema changes. Given an action (add_column, remove_column, rename_column, add_index, add_association, change_type), generates the migration, flags irreversible operations, and shows affected models. Use when: adding fields, changing schema, planning database changes. Key params: action, table, column, type, new_name (for rename_column).

Input Schema

NameRequiredDescriptionDefault
typeNoColumn type (e.g., 'string', 'integer', 'boolean', 'references'). For add_association with column, the table the reference points at (e.g., 'users').
tableYesTable name (e.g., 'users', 'posts')
actionYesMigration action to perform
columnNoColumn name (e.g., 'email', 'status'). For add_association, the reference (e.g., 'user', 'parent').
optionsNoAdditional options (e.g., 'null: false, default: 0')
new_nameNoNew column name - only for rename_column action (e.g., 'full_name')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.39.1

TDQS

A3.9/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 the description usefully adds what the response contains: the generated migration, irreversible-operation flags, and affected models. The one notable omission is that it never says the migration is only generated and not applied to the database — an agent calling 'remove_column' has to infer that from readOnlyHint.

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 core action and followed by usage scope and params. Minor waste in the trailing param list, which duplicates schema detail, but overall no padding.

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?

For a 6-parameter generator with no output schema, the description covers what is produced (migration code, irreversibility warnings, affected models) and which actions are supported. Only the generate-vs-apply distinction and any output-format/precondition detail are missing.

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% with per-parameter descriptions and an enum on action, so the schema already carries the load. The description's 'Key params' list and the new_name-for-rename_column note largely restate schema text rather than adding new semantics.

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?

States a specific verb and resource: 'Generates migration code for schema changes', and enumerates the six/seven supported actions. It is unambiguous versus siblings like rails_get_schema or rails_validate, though it never explicitly names an alternative tool.

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 'Use when:' clause (adding fields, changing schema, planning database changes) that maps situations to the tool. It gives no when-not guidance or named alternative for adjacent tasks (e.g., inspecting an existing schema), which keeps it 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.