Skip to main content
Glama
hendrickcastro

MCP CosmosDB

mcp_list_databases

Retrieve a list of all databases in your Azure CosmosDB account to manage and analyze your document storage resources.

Instructions

List all databases in the CosmosDB account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringYesDummy parameter for no-parameter tools

Implementation Reference

  • The handler function that executes the logic to list all databases in the CosmosDB account using the client API.
    export const mcp_list_databases = async (): Promise<ToolResult<DatabaseInfo[]>> => {
      console.log('Executing mcp_list_databases');
    
      try {
        const database = getDatabase();
        const client = database.client;
        
        const { resources: databases } = await client.databases.readAll().fetchAll();
        
        const databasesInfo: DatabaseInfo[] = databases.map(db => ({
          id: db.id,
          etag: db._etag,
          timestamp: new Date(db._ts * 1000)
        }));
    
        return { success: true, data: databasesInfo };
      } catch (error: any) {
        console.error(`Error in mcp_list_databases: ${error.message}`);
        return { success: false, error: error.message };
      }
    };
  • src/tools.ts:4-16 (registration)
    Tool registration in MCP_COSMOSDB_TOOLS array, defining name, description, and input schema for the MCP ListTools request.
      name: "mcp_list_databases",
      description: "List all databases in the CosmosDB account",
      inputSchema: {
        type: "object",
        properties: {
          random_string: {
            type: "string",
            description: "Dummy parameter for no-parameter tools"
          }
        },
        required: ["random_string"]
      }
    },
  • TypeScript interface defining the structure of DatabaseInfo returned by the tool.
    export interface DatabaseInfo {
      id: string;
      throughput?: number;
      etag: string;
      timestamp: Date;
    }
  • Type definitions for tool results, used as return type for the handler.
    export type ToolSuccessResult<T> = { success: true; data: T; };
    export type ToolErrorResult = { success: false; error: string; };
    export type ToolResult<T> = ToolSuccessResult<T> | ToolErrorResult;
  • src/server.ts:91-92 (registration)
    Dispatch/registration in the CallTool handler switch statement that invokes the tool handler.
    case 'mcp_list_databases':
        result = await toolHandlers.mcp_list_databases();
Behavior2/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 the tool lists databases but doesn't disclose behavioral traits like whether this requires specific permissions, how results are formatted (e.g., pagination, sorting), rate limits, or error conditions. For a tool with zero annotation coverage, this is a significant gap in behavioral context.

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 a single, clear sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration, 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.

Completeness3/5

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

Given the tool's low complexity (a simple list operation), no annotations, no output schema, and full schema coverage for a dummy parameter, the description is minimally adequate. It states what the tool does but lacks context on usage, behavior, or output, leaving gaps that could hinder an agent's effective use without additional inference.

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 100% description coverage, with one parameter documented as a 'Dummy parameter for no-parameter tools.' The description doesn't add any parameter information beyond this, which is appropriate since the schema fully covers the single parameter. With zero meaningful parameters, a baseline of 4 is warranted as the description needn't compensate for schema gaps.

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 ('List all databases') and resource ('in the CosmosDB account'), providing specific verb+resource pairing. However, it doesn't differentiate from sibling tools like 'mcp_list_containers' which suggests similar listing functionality for different resources, leaving room for improvement in sibling differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'mcp_list_containers' and 'mcp_get_documents' available, there's no indication of when database listing is appropriate versus container or document operations, nor any prerequisites or exclusions mentioned.

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