Skip to main content
Glama
bpamiri

CockroachDB MCP Server

by bpamiri

disconnect

Terminate the active connection to the CockroachDB cluster to end database sessions and release resources.

Instructions

Disconnect from the CockroachDB cluster.

Returns:
    Disconnection status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'disconnect', registered with @mcp.tool() decorator. Delegates disconnection to the connection_manager.
    @mcp.tool()
    async def disconnect() -> dict[str, Any]:
        """Disconnect from the CockroachDB cluster.
    
        Returns:
            Disconnection status.
        """
        return await connection_manager.disconnect()
  • Core implementation of disconnection logic in ConnectionManager class, closes the AsyncConnection and resets state.
    async def disconnect(self) -> dict[str, Any]:
        """Disconnect from CockroachDB cluster.
    
        Returns:
            Disconnection status.
        """
        async with self._lock:
            if self._state.connection is None:
                return {"status": "not_connected"}
    
            try:
                await self._state.connection.close()
            except Exception:
                pass  # Ignore errors on close
    
            database = self._state.database
            self._state = ConnectionState()
    
            return {
                "status": "disconnected",
                "database": database,
            }
Behavior3/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 mentions the return value ('Disconnection status'), which adds useful context beyond the basic action. However, it doesn't cover potential side effects (e.g., terminating active sessions, impact on transactions) or error conditions, leaving gaps for a mutation tool.

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 extremely concise with two brief sentences: one stating the action and one describing the return. It is front-loaded with the core purpose and wastes no words, making it highly efficient and well-structured.

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 the tool's simplicity (0 parameters, output schema exists), the description is reasonably complete. It covers the action and return value, and the output schema handles return details. However, as a mutation tool with no annotations, it could benefit from more behavioral context (e.g., idempotency, errors) to reach a perfect score.

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 appropriately doesn't add parameter details, maintaining focus on the action and output. A baseline of 4 is applied since no parameters exist to document.

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 action ('Disconnect from') and resource ('CockroachDB cluster'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'connect' beyond the obvious opposite action, which prevents a perfect score.

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 when disconnection is needed, but provides no explicit guidance on when to use this tool versus alternatives (e.g., after completing operations, in error scenarios) or prerequisites (e.g., must be connected first). The context is clear but lacks detailed when/when-not instructions.

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

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