Skip to main content
Glama
bpamiri

CockroachDB MCP Server

by bpamiri

show_zone_config

Retrieve zone configuration settings for CockroachDB tables to manage data distribution, replication, and storage policies across cluster nodes.

Instructions

Show zone configurations.

Args:
    table: Optional table to get zone config for.

Returns:
    Zone configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNo

Implementation Reference

  • Core handler function that executes the SQL queries to show zone configurations for a table or all.
    async def show_zone_config(table: str | None = None) -> dict[str, Any]:
        """Show zone configurations.
    
        Args:
            table: Optional table to get zone config for.
    
        Returns:
            Zone configuration.
        """
        conn = await connection_manager.ensure_connected()
    
        try:
            if table:
                query = f"SHOW ZONE CONFIGURATION FOR TABLE {table}"
            else:
                query = "SHOW ZONE CONFIGURATIONS"
    
            async with conn.cursor() as cur:
                await cur.execute(query)
                rows = await cur.fetchall()
    
            configs = []
            for row in rows:
                configs.append(
                    {
                        "target": row.get("target"),
                        "raw_config_sql": row.get("raw_config_sql"),
                    }
                )
    
            return {"zone_configs": configs, "count": len(configs), "table_filter": table}
        except Exception as e:
            return {"status": "error", "error": str(e)}
  • Tool registration using @mcp.tool() decorator. Delegates execution to the cluster module's implementation.
    async def show_zone_config(table: str | None = None) -> dict[str, Any]:
        """Show zone configurations.
    
        Args:
            table: Optional table to get zone config for.
    
        Returns:
            Zone configuration.
        """
        try:
            return await cluster.show_zone_config(table)
        except Exception as e:
            return {"status": "error", "error": str(e)}

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/bpamiri/cockroachdb-mcp'

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