Skip to main content
Glama
abushadab

Self-Hosted Supabase MCP Server

by abushadab

list_extensions

Retrieve a detailed list of all PostgreSQL extensions installed in your database using the Self-Hosted Supabase MCP Server, enabling efficient database management and feature inspection.

Instructions

Lists all installed PostgreSQL extensions in the database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute function implementing the tool logic: queries pg_extension table for installed extensions (excluding plpgsql), using utilities for SQL execution and response handling.
    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 input (empty), output (array of {name, schema, version, description}), and MCP JSON input schema 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>;
    // Static JSON Schema for MCP capabilities
    const mcpInputSchema = {
        type: 'object', 
        properties: {},
        required: [],
    };
  • src/index.ts:101-101 (registration)
    Registers the listExtensionsTool in the availableTools map used by the MCP server.
    [listExtensionsTool.name]: listExtensionsTool as AppTool,

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior2/5

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

No annotations provided; description does not disclose behavioral traits such as permissions needed or whether it is read-only. Minimal transparency.

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?

Single sentence, no wasted words. Clearly front-loaded and efficient.

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 simple list tool with no parameters, the description is sufficient. However, it could mention the return format (e.g., extension names only) since no output schema exists.

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?

No parameters, baseline of 4. Description adds no extra meaning beyond schema (empty), but that is acceptable given zero parameters.

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?

Clearly states verb 'Lists' and specific resource 'all installed PostgreSQL extensions in the database,' distinguishing it from sibling tools like list_tables or list_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?

No explicit when-to-use or alternative guidance. Usage is implied but could benefit from mentioning that it is a safe read operation.

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