Skip to main content
Glama

Apply a Project Database migration

apply_project_database_migration
DestructiveIdempotent

Apply an additive migration as its owner in one transaction. Destructive changes return migration_requires_admin_approval with the UI review URL; this tool cannot approve them. Retry the same additive migration ID after an uncertain outcome to reconcile without repeating committed SQL. Retry destructive migrations from their UI approval screen. Migration responses include request_review: adding unrelated tables preserves existing approvals; changes to referenced schema objects can interrupt affected Requests. Some changes still invalidate every Request on the datasource: a removed or changed function, a sequence no table owns, a new function whose name already resolves or is named by existing function code, or a stored schema fingerprint the Engine cannot recognize. After apply or an uncertain response, list migration history for recorded affected Requests, current policy states, and review URLs. If request_review.state is unavailable, the recorded migration outcome remains valid but its affected_requests is null; refresh history before resuming applications. Review stale approvals through existing Request review/update flows; do not automatically reapprove or retry application writes.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "datasource_id": "<datasource_id>",
      "migration_id": "<migration_id>"
    },
    "name": "apply_project_database_migration"
  }
}

Input Schema

NameRequiredDescriptionDefault
migration_idYesID returned by propose_project_database_migration
datasource_idYesProject Database datasource UUID
application_idNoOptional Application UUID whose build this call serves (Administrator only). Setup steps this call opens record it, so they show on that Application's build screen; the resources themselves stay shared by the Project. A shared step it reuses keeps the Application it was opened for, so a step it returns may be watchable with get_setup_journal only without application_id. Use the build's application_id, the one you call describe_application with.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, and the description adds substantial context beyond them: transactional execution as owner, the migration_requires_admin_approval error with UI review URL, safe retry semantics for additive migrations, request_review preservation/interruption rules, specific schema-object invalidation cases, and the request_review.state unavailable fallback. No annotation contradiction: the retry guidance is consistent with idempotentHint=true and the approval-required behavior is consistent with destructiveHint=true.

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?

The description is front-loaded with the core action and then packs dense operational guidance into subsequent sentences; nearly every sentence carries behavioral information. It is somewhat long and would scan better if the edge cases were split into bullets, but it avoids fluff and repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex, destructive mutation tool with no output schema, the description covers execution semantics, error codes, retry rules, side effects on approvals, invalidation cases, and the recommended follow-up call. There is no output schema to explain return values, and the description supplies enough context that an agent could safely invoke the tool and interpret common failure states.

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 the schema already documents all three parameters, including the application_id ownership nuance. The description adds some meaning to migration_id through its retry guidance, but it does not expand on datasource_id or application_id semantics beyond what the schema provides, so the baseline of 3 is appropriate.

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 ('Apply an additive migration as its owner in one transaction') and immediately distinguishes the destructive path by saying destructive changes return migration_requires_admin_approval and that this tool cannot approve them. An agent can differentiate it from propose_project_database_migration, dry_run_project_database_migration, and list_project_database_migrations without opening another schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance: retry the same additive migration ID after an uncertain outcome, but retry destructive migrations from their UI approval screen, and follow up with migration history. It also states what not to do ('do not automatically reapprove or retry application writes') and routes stale approvals through existing Request review/update flows.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources