Skip to main content
Glama
HenkDz

Self-Hosted Supabase MCP Server

list_migrations

View applied database migrations to track schema changes and deployment history in self-hosted Supabase instances.

Instructions

Lists applied database migrations recorded in supabase_migrations.schema_migrations table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute handler function that runs an SQL query to list applied Supabase migrations from the schema_migrations table, handles potential errors if the table doesn't exist, and returns the parsed result.
    execute: async (input: ListMigrationsInput, context: ToolContext) => {
        const client = context.selfhostedClient;
    
        // SQL to query the Supabase migrations table
        const listMigrationsSql = `
            SELECT
                version,
                name,
                inserted_at
            FROM
                supabase_migrations.schema_migrations
            ORDER BY
                version
        `;
    
        // This table might not exist if migrations haven't been run
        // The RPC call will handle the error, which handleSqlResponse will catch
        const result = await executeSqlWithFallback(client, listMigrationsSql, true);
    
        return handleSqlResponse(result, ListMigrationsOutputSchema);
    },
  • Zod schema for the tool's output: an array of objects containing migration version, name, and inserted_at timestamp.
    const ListMigrationsOutputSchema = z.array(z.object({
        version: z.string(),
        name: z.string(),
        inserted_at: z.string(), // Keep as string from DB
    }));
  • Zod schema for the tool's input (empty object, no parameters required).
    const ListMigrationsInputSchema = z.object({});
    type ListMigrationsInput = z.infer<typeof ListMigrationsInputSchema>;
  • src/index.ts:102-102 (registration)
    Registration of the listMigrationsTool in the availableTools object used by the MCP server.
    [listMigrationsTool.name]: listMigrationsTool as AppTool,
  • src/index.ts:13-13 (registration)
    Import of the listMigrationsTool for registration in the main index file.
    import { listMigrationsTool } from './tools/list_migrations.js';
Behavior2/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 states it 'Lists applied database migrations,' implying a read-only operation, but doesn't disclose behavioral traits like permissions needed, rate limits, output format (e.g., list of migration IDs/timestamps), or pagination. For a tool with zero annotation coverage, this is inadequate.

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 a single, efficient sentence that front-loads the core action ('Lists applied database migrations') and adds specific detail ('recorded in supabase_migrations.schema_migrations table'). Every word earns its place with no redundancy or fluff.

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

Completeness2/5

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

Given no annotations, no output schema, and zero parameters, the description is minimal. It states what the tool does but lacks context on behavior, output, or usage. For a tool that likely returns structured migration data, this leaves the agent guessing about results and applicability.

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 tool has 0 parameters, and schema description coverage is 100% (though trivial here). The description doesn't need to add parameter semantics, so it meets the baseline of 4 for zero-parameter tools. No extra value is required beyond stating the purpose.

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?

The description clearly states the verb ('Lists') and resource ('applied database migrations'), specifying the exact table ('supabase_migrations.schema_migrations'). It distinguishes from siblings like 'list_tables' or 'list_extensions' by focusing on migrations. However, it doesn't explicitly differentiate from hypothetical similar tools (e.g., 'list_pending_migrations'), so it's not a perfect 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., after applying migrations), exclusions (e.g., not for pending migrations), or related tools like 'apply_migration'. The agent must infer usage from the purpose alone.

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/HenkDz/selfhosted-supabase-mcp'

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