Skip to main content
Glama
HenkDz

Self-Hosted Supabase MCP Server

list_realtime_publications

Retrieve PostgreSQL publications configured for Supabase Realtime to monitor database changes and enable real-time data synchronization.

Instructions

Lists PostgreSQL publications, often used by Supabase Realtime.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute function implementing the tool logic: checks for direct PG connection, executes SQL query on pg_catalog.pg_publication, validates output with Zod schema.
    execute: async (
        input: ListRealtimePublicationsInput,
        context: ToolContext
    ): Promise<ListRealtimePublicationsOutput> => {
        const client = context.selfhostedClient;
        console.error('Listing Realtime publications...');
    
        // Direct DB connection likely needed for pg_catalog access
        if (!client.isPgAvailable()) {
            context.log('Direct database connection (DATABASE_URL) is required to list publications.', 'error');
            throw new Error('Direct database connection (DATABASE_URL) is required to list publications.');
        }
    
        const sql = `
            SELECT
                oid,
                pubname,
                pubowner,
                puballtables,
                pubinsert,
                pubupdate,
                pubdelete,
                pubtruncate,
                pubviaroot
            FROM pg_catalog.pg_publication;
        `;
    
        console.error('Attempting to list publications using direct DB connection...');
        // Use executeSqlWithPg as it's a simple read query without parameters
        const result = await client.executeSqlWithPg(sql);
    
        const validatedPublications = handleSqlResponse(result, ListRealtimePublicationsOutputSchema);
    
        console.error(`Found ${validatedPublications.length} publications.`);
        context.log(`Found ${validatedPublications.length} publications.`);
        return validatedPublications;
    },
  • Zod schemas for input (empty) and output (array of Publication objects matching pg_publication columns).
    const ListRealtimePublicationsInputSchema = z.object({});
    type ListRealtimePublicationsInput = z.infer<typeof ListRealtimePublicationsInputSchema>;
    
    // Output schema based on pg_publication columns
    const PublicationSchema = z.object({
        oid: z.number().int(),
        pubname: z.string(),
        pubowner: z.number().int(), // Owner OID
        puballtables: z.boolean(),
        pubinsert: z.boolean(),
        pubupdate: z.boolean(),
        pubdelete: z.boolean(),
        pubtruncate: z.boolean(),
        pubviaroot: z.boolean(),
        // Potentially add pubownername if needed via join
    });
    const ListRealtimePublicationsOutputSchema = z.array(PublicationSchema);
    type ListRealtimePublicationsOutput = z.infer<typeof ListRealtimePublicationsOutputSchema>;
  • src/index.ts:120-120 (registration)
    The tool is registered in the availableTools object, which is used to populate the MCP server's tool capabilities.
    [listRealtimePublicationsTool.name]: listRealtimePublicationsTool as AppTool,
  • Static JSON schema for MCP input, required for tool capabilities declaration.
    export const mcpInputSchema = {
        type: 'object',
        properties: {},
        required: [],
    };
  • src/index.ts:34-34 (registration)
    Import of the list_realtime_publications tool module.
    import listRealtimePublicationsTool from './tools/list_realtime_publications.js';
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a list operation, implying read-only behavior, but doesn't disclose any behavioral traits like pagination, rate limits, authentication requirements, or what specific publication data is returned. 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 with zero waste. It's front-loaded with the core purpose and adds only relevant context about Supabase Realtime. Every word earns its place, making it appropriately sized.

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 and no output schema, the description is incomplete. It doesn't explain what the list returns (e.g., publication names, details, format) or any behavioral aspects. For a list operation in a complex environment with many siblings, more context is needed to be fully helpful.

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 with 100% schema description coverage, so the schema fully documents the absence of inputs. The description doesn't need to add parameter information, and it correctly doesn't mention any. Baseline for 0 parameters is 4, as it avoids unnecessary details.

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 ('PostgreSQL publications'), providing a specific purpose. It also adds context about Supabase Realtime usage, which is helpful. However, it doesn't explicitly distinguish this tool from sibling tools like 'list_tables' or 'list_extensions', which would require a 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 mentions Supabase Realtime context, but doesn't specify scenarios, prerequisites, or exclusions. With many sibling tools available, this lack of differentiation is a significant gap.

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