Skip to main content
Glama

export_alter_sql

Generate ALTER migration scripts by diffing a baseline model against the current state, preserving renames, commenting destructive changes, and flagging unsupported changes with WARNING comments.

Instructions

Generates a migration (ALTER) script from the physical diff between a baseline and the current model — renames stay renames (stable-id matching), destructive changes come commented out, unsupported changes are flagged as [WARNING] comments. Baselines from the same project lineage ({file}/{erdId}) preserve renames; freshly parsed SQL/DBML text falls back to name matching. Pro plan required; requires login.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterYesTarget state (the current model)
beforeYesBaseline (e.g. the state last applied to the database)
dialectNoSQL dialect
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It discloses stable-id matching for renames, destructive changes commented out, [WARNING] comments for unsupported changes, the impact of baseline lineage (file/erdId) versus fresh SQL/DBML, and requirements for Pro plan and login. This is comprehensive behavioral disclosure.

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?

The description is three sentences, each dense with information. It front-loads the primary action and output traits, then explains matching behavior, and finally access requirements. No redundant phrases or 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?

Given the tool's complex input (multiple forms for baseline/target) and lack of output schema, the description adequately covers the main behavior and output characteristics. It mentions the script includes commented destructive changes and WARNING flags, but does not detail the exact output format or error cases. It does address auth and plan requirements.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides descriptions for all three parameters (100% coverage), so the baseline is 3. The description adds value by explaining how the choice of baseline type (file/erdId vs SQL/DBML) affects rename matching, which is not in the schema. This goes beyond simple parameter definitions.

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?

The description clearly states the tool generates a migration (ALTER) script from a physical diff between baseline and current model. It specifies key output characteristics (renames preserved, destructive changes commented out, unsupported changes flagged), which strongly distinguishes it from siblings like export_sql or diff_erds.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context that this tool is for generating migration scripts, but does not explicitly compare with alternatives or state when not to use it. It mentions lineage-based rename preservation versus fallback for fresh SQL/DBML, which hints at usage conditions but without explicit exclusions or alternative recommendations.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sqemo/sqemo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server