Skip to main content
Glama
alexander-zuev

Supabase MCP Server

get_tables

Retrieve detailed metadata, row counts, and sizes for all tables, views, and foreign tables in a specified PostgreSQL schema on Supabase. Supports safe read operations for database inspection.

Instructions

List all tables, foreign tables, and views in a schema with their sizes, row counts, and metadata.

Provides detailed information about all database objects in the specified schema:

  • Table/view names

  • Object types (table, view, foreign table)

  • Row counts

  • Size on disk

  • Column counts

  • Index information

  • Last vacuum/analyze times

Parameters:

  • schema_name: Name of the schema to inspect (e.g., 'public', 'auth', etc.)

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schema_nameYes

Implementation Reference

  • Primary MCP-registered handler for the 'get_tables' tool. Defines input (schema_name: str), output (QueryResult), description, and delegates to feature manager for execution.
    @mcp.tool(description=tool_manager.get_description(ToolName.GET_TABLES))  # type: ignore
    async def get_tables(schema_name: str) -> QueryResult:
        """List all tables, foreign tables, and views in a schema with their sizes, row counts, and metadata."""
        return await feature_manager.execute_tool(
            ToolName.GET_TABLES, services_container=services_container, schema_name=schema_name
        )
  • Core execution logic for get_tables: retrieves the SQL query via query_manager and executes it, performing the actual tool operation.
    async def get_tables(self, container: "ServicesContainer", schema_name: str) -> QueryResult:
        """List all tables, foreign tables, and views in a schema with their sizes, row counts, and metadata."""
        query_manager = container.query_manager
        query = query_manager.get_tables_query(schema_name)
        return await query_manager.handle_query(query)
  • Dispatch registration in FeatureManager.execute_tool that routes ToolName.GET_TABLES to the get_tables handler.
    elif tool_name == ToolName.GET_TABLES:
        return await self.get_tables(services_container, **kwargs)
  • Helper method to generate the SQL query string for listing tables in a schema by delegating to SQLLoader.
    def get_tables_query(self, schema_name: str) -> str:
        """Get a query to list all tables in a schema."""
        return self.sql_loader.get_tables_query(schema_name)
  • Helper that loads the 'get_tables.sql' template and parameterizes it with the schema_name.
    def get_tables_query(cls, schema_name: str) -> str:
        """Get a query to list all tables in a schema."""
        query = cls.load_sql("get_tables")
        return query.replace("{schema_name}", schema_name)
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that this is a 'low-risk read operation' and can be executed in 'SAFE mode', which clarifies safety and behavioral traits. However, it lacks details on rate limits, permissions needed, or potential performance impacts.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear summary, bulleted details, and a dedicated safety note. It is appropriately sized, but could be slightly more concise by integrating the safety note into the main text.

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?

Given no annotations and no output schema, the description does a good job explaining the tool's purpose, parameters, and safety. It lists the information returned (e.g., row counts, sizes), but could benefit from clarifying the output format or any limitations.

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?

The schema description coverage is 0%, so the description must compensate. It explicitly defines the single parameter 'schema_name' with meaning ('Name of the schema to inspect') and examples ('public', 'auth'), adding 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 ('List') and resource ('all tables, foreign tables, and views in a schema') with specific attributes ('sizes, row counts, and metadata'). It distinguishes from siblings like get_schemas (which lists schemas) and get_table_schema (which provides schema details for a single table).

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 for inspecting database objects in a schema, but does not explicitly state when to use this tool versus alternatives like get_schemas or get_table_schema. No exclusions or prerequisites are mentioned, leaving some ambiguity in context.

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