Skip to main content
Glama
hendrickcastro

MCP CosmosDB

mcp_list_connections

List all configured CosmosDB connections to discover available connection IDs for accessing different CosmosDB accounts and databases.

Instructions

List all available CosmosDB connections configured in this MCP server. Use this to discover which connection_id values you can use. Each connection points to a different CosmosDB account/database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler for mcp_list_connections tool. Fetches all registered CosmosDB connections via getRegisteredConnectionsInfo() and returns them with a default connection.
    export const mcp_list_connections = async (): Promise<ToolResult<{
      connections: Array<{id: string; databaseId: string; description?: string; isConnected: boolean}>;
      defaultConnection: string | null;
    }>> => {
      log(`Executing mcp_list_connections`);
      
      try {
        const connections = getRegisteredConnectionsInfo();
        const defaultConn = connections.find(c => c.isConnected)?.id || connections[0]?.id || null;
        
        return { 
          success: true, 
          data: {
            connections,
            defaultConnection: defaultConn
          }
        };
      } catch (error: any) {
        log(`Error in mcp_list_connections: ${error.message}`);
        return { success: false, error: error.message };
      }
    };
  • Tool registration with name 'mcp_list_connections' and empty inputSchema (no parameters required).
    export const MCP_COSMOSDB_TOOLS = [
      // 0. List Available Connections - NEW!
      {
        name: "mcp_list_connections",
        description: "List all available CosmosDB connections configured in this MCP server. Use this to discover which connection_id values you can use. Each connection points to a different CosmosDB account/database.",
        inputSchema: {
          type: "object",
          properties: {},
          required: []
        }
      },
  • Re-exports mcp_list_connections from dataOperations module so it can be imported by the server.
    export {
      mcp_list_connections,
  • src/server.ts:112-116 (registration)
    Switch-case in CallToolRequestSchema handler that routes 'mcp_list_connections' to the handler function.
    switch (toolName) {
        // Connection management
        case 'mcp_list_connections':
            result = await toolHandlers.mcp_list_connections();
            break;
  • Helper function getRegisteredConnectionsInfo that reads registered connection configs and returns them with isConnected status.
    /**
     * Get all registered connections info (without sensitive data)
     */
    export const getRegisteredConnectionsInfo = (): Array<{id: string; databaseId: string; description?: string; isConnected: boolean}> => {
      return Array.from(registeredConnections.values()).map(conn => ({
        id: conn.id,
        databaseId: conn.databaseId,
        description: conn.description,
        isConnected: activeConnections.has(conn.id)
      }));
    };
Behavior3/5

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

No annotations are provided, so the description carries full burden. It states each connection points to a different account/database, which is helpful. However, it does not disclose any other behavioral traits like read-only or side effects.

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?

Two sentences with no wasted words. The purpose is front-loaded and the description is perfectly concise for a simple list tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no parameters and no output schema, the description is complete. It explains what the tool lists and how to use the outputs (connection_id values). No gaps identified.

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 input schema has no parameters, so the description adds meaning by explaining what the tool does. Baseline for 0 parameters is 4, and the description provides clear context.

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 tool lists all CosmosDB connections, distinguishing it from sibling tools like mcp_list_databases (which lists databases) and other query tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells agents to use this to discover connection_id values, providing clear context. Does not mention when not to use, but for a simple list tool this is sufficient.

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/hendrickcastro/MCPCosmosDB'

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