Skip to main content
Glama
HenkDz

Self-Hosted Supabase MCP Server

list_extensions

Lists all PostgreSQL extensions installed in your self-hosted Supabase database to help manage database features and dependencies.

Instructions

Lists all installed PostgreSQL extensions in the database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The complete implementation of the 'list_extensions' tool handler, which executes a SQL query against pg_extension to list installed extensions (excluding plpgsql), processes the result with helpers, and returns validated output.
    export const listExtensionsTool = {
        name: 'list_extensions',
        description: 'Lists all installed PostgreSQL extensions in the database.',
        inputSchema: ListExtensionsInputSchema,
        mcpInputSchema: mcpInputSchema,
        outputSchema: ListExtensionsOutputSchema,
        execute: async (input: ListExtensionsInput, context: ToolContext) => {
            const client = context.selfhostedClient;
    
            // SQL based on pg_extension
            const listExtensionsSql = `
                SELECT
                    pe.extname AS name,
                    pn.nspname AS schema,
                    pe.extversion AS version,
                    pd.description
                FROM
                    pg_catalog.pg_extension pe
                LEFT JOIN
                    pg_catalog.pg_namespace pn ON pn.oid = pe.extnamespace
                LEFT JOIN
                    pg_catalog.pg_description pd ON pd.objoid = pe.oid AND pd.classoid = 'pg_catalog.pg_extension'::regclass
                WHERE
                    pe.extname != 'plpgsql' -- Exclude the default plpgsql extension
                ORDER BY
                    pe.extname
            `;
    
            const result = await executeSqlWithFallback(client, listExtensionsSql, true);
    
            return handleSqlResponse(result, ListExtensionsOutputSchema);
        },
    }; 
  • Zod schemas defining the input (empty object) and output structure (array of objects with name, schema, version, and optional description) for the list_extensions tool.
    const ListExtensionsOutputSchema = z.array(z.object({
        name: z.string(),
        schema: z.string(),
        version: z.string(),
        description: z.string().nullable().optional(),
    }));
    
    // Input schema (none needed for this tool)
    const ListExtensionsInputSchema = z.object({});
    type ListExtensionsInput = z.infer<typeof ListExtensionsInputSchema>;
  • src/index.ts:100-102 (registration)
    Registration of the listExtensionsTool into the availableTools object, which is used to populate the MCP server's tool capabilities and handlers.
    [listTablesTool.name]: listTablesTool as AppTool,
    [listExtensionsTool.name]: listExtensionsTool as AppTool,
    [listMigrationsTool.name]: listMigrationsTool as AppTool,
  • src/index.ts:12-12 (registration)
    Import statement that brings the listExtensionsTool into the main index file for registration.
    import { listExtensionsTool } from './tools/list_extensions.js';
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves: no information on output format (e.g., list structure, fields returned), pagination, error conditions, or whether it requires specific permissions. This leaves significant gaps for an agent to understand the tool's operation.

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, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable and efficient. Every word earns its place by specifying the exact scope ('all installed PostgreSQL extensions').

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 the tool's simplicity (0 parameters) but lack of annotations and output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., array of extension names with versions), which is critical for a list operation. For a read-only tool with no structured output documentation, more behavioral context is needed.

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 empty). The description appropriately doesn't discuss parameters since none exist. It could theoretically mention that no inputs are required, but this is adequately covered by the schema, so a baseline 4 is appropriate.

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 ('all installed PostgreSQL extensions in the database'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'list_tables' or 'list_auth_users', but the specificity of 'PostgreSQL extensions' provides inherent distinction.

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., database connection), use cases (e.g., checking available extensions before installation), or how it differs from other list tools like 'list_tables' or 'list_auth_users'.

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