Skip to main content
Glama
alexander-zuev

Supabase MCP Server

retrieve_migrations

Retrieve detailed information about Supabase database migrations, including version, name, and SQL statements. Use filters for pagination, name patterns, and query inclusion with this low-risk read tool.

Instructions

Retrieve a list of all migrations a user has from Supabase.

Returns a list of migrations with the following information:

  • Version (timestamp)

  • Name

  • SQL statements (if requested)

  • Statement count

  • Version type (named or numbered)

Parameters:

  • limit: Maximum number of migrations to return (default: 50, max: 100)

  • offset: Number of migrations to skip for pagination (default: 0)

  • name_pattern: Optional pattern to filter migrations by name. Uses SQL ILIKE pattern matching (case-insensitive). The pattern is automatically wrapped with '%' wildcards, so "users" will match "create_users_table", "add_email_to_users", etc. To search for an exact match, use the complete name.

  • include_full_queries: Whether to include the full SQL statements in the result (default: false)

SAFETY: This is a low-risk read operation that can be executed in SAFE mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_full_queriesNo
limitNo
name_patternNo
offsetNo

Implementation Reference

  • Core handler implementing the retrieve_migrations tool logic: generates SQL query for migrations using query_manager and executes it.
    async def retrieve_migrations(
        self,
        container: "ServicesContainer",
        limit: int = 50,
        offset: int = 0,
        name_pattern: str = "",
        include_full_queries: bool = False,
    ) -> QueryResult:
        """Retrieve a list of all migrations a user has from Supabase."""
        query_manager = container.query_manager
        query = query_manager.get_migrations_query(
            limit=limit, offset=offset, name_pattern=name_pattern, include_full_queries=include_full_queries
        )
        return await query_manager.handle_query(query)
  • Registers the retrieve_migrations tool with the MCP server using @mcp.tool decorator, defines input schema and description, delegates execution to feature_manager.
    @mcp.tool(description=tool_manager.get_description(ToolName.RETRIEVE_MIGRATIONS))  # type: ignore
    async def retrieve_migrations(
        limit: int = 50,
        offset: int = 0,
        name_pattern: str = "",
        include_full_queries: bool = False,
    ) -> QueryResult:
        """Retrieve a list of all migrations a user has from Supabase.
    
        SAFETY: This is a low-risk read operation that can be executed in SAFE mode.
        """
    
        result = await feature_manager.execute_tool(
            ToolName.RETRIEVE_MIGRATIONS,
            services_container=services_container,
            limit=limit,
            offset=offset,
            name_pattern=name_pattern,
            include_full_queries=include_full_queries,
        )
        return QueryResult.model_validate(result)
  • Defines the input schema (parameters with types and defaults) and output type (QueryResult) for the retrieve_migrations tool.
    @mcp.tool(description=tool_manager.get_description(ToolName.RETRIEVE_MIGRATIONS))  # type: ignore
    async def retrieve_migrations(
        limit: int = 50,
        offset: int = 0,
        name_pattern: str = "",
        include_full_queries: bool = False,
    ) -> QueryResult:
        """Retrieve a list of all migrations a user has from Supabase.
    
        SAFETY: This is a low-risk read operation that can be executed in SAFE mode.
        """
    
        result = await feature_manager.execute_tool(
            ToolName.RETRIEVE_MIGRATIONS,
            services_container=services_container,
            limit=limit,
            offset=offset,
            name_pattern=name_pattern,
            include_full_queries=include_full_queries,
        )
        return QueryResult.model_validate(result)
  • Defines the ToolName.RETRIEVE_MIGRATIONS constant used throughout for referencing the tool.
    RETRIEVE_MIGRATIONS = "retrieve_migrations"
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing the SAFE mode operation, pagination behavior (limit/offset defaults), and pattern matching behavior for name_pattern. It doesn't mention rate limits, authentication needs, or error conditions, but provides solid behavioral context.

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?

Well-structured with purpose statement, return format details, parameter explanations, and safety note. Every sentence earns its place with no redundancy. The information is front-loaded with the core purpose first.

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 read operation with no annotations and no output schema, the description provides good completeness: clear purpose, detailed parameter semantics, safety context, and return format details. It could mention authentication requirements or error scenarios, but covers the essential context well.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining all 4 parameters in detail: default values, constraints (max: 100), and behavioral semantics (especially the ILIKE pattern matching with automatic wildcards for name_pattern). This adds significant value beyond the bare schema.

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 verb ('Retrieve') and resource ('list of all migrations a user has from Supabase'), with specific details about what information is returned. It distinguishes itself from sibling tools like 'retrieve_logs' or 'get_tables' by focusing specifically on migrations.

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 implies usage through the SAFE mode note and parameter explanations, but doesn't explicitly state when to use this tool versus alternatives like 'retrieve_logs' or 'get_schemas'. No explicit when-not-to-use guidance or named alternatives are provided.

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

Related 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/alexander-zuev/supabase-mcp-server'

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