Skip to main content
Glama
hendrickcastro

MCP CosmosDB

mcp_container_info

Retrieve detailed container information and throughput settings for Azure CosmosDB to analyze database performance and configuration.

Instructions

Get detailed information about a specific container including throughput settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
container_idYesThe ID of the container to analyze

Implementation Reference

  • The async function implementing the core logic of the mcp_container_info tool. It retrieves detailed container information including partition key, indexing policy, etag, timestamp, and optional throughput settings from the CosmosDB container.
    export const mcp_container_info = async (args: { container_id: string }): Promise<ToolResult<ContainerInfo & { throughputInfo?: any }>> => {
      const { container_id } = args;
      console.log('Executing mcp_container_info with:', args);
    
      try {
        const container = getContainer(container_id);
        
        // Read container definition
        const { resource: containerDef } = await container.read();
        
        // Try to read throughput settings
        let throughputInfo;
        try {
          const offerResponse = await container.readOffer();
          throughputInfo = offerResponse.resource;
        } catch (offerError) {
          // Throughput might not be defined for shared throughput containers
          console.log('Could not read container throughput (might use shared database throughput)');
        }
    
        if (!containerDef) {
          throw new Error(`Container ${container_id} not found`);
        }
    
        const containerInfo: ContainerInfo & { throughputInfo?: any } = {
          id: containerDef.id,
          partitionKey: containerDef.partitionKey ? {
            paths: containerDef.partitionKey.paths || [],
            kind: containerDef.partitionKey.kind
          } : undefined,
          indexingPolicy: containerDef.indexingPolicy,
          etag: containerDef._etag,
          timestamp: containerDef._ts ? new Date(containerDef._ts * 1000) : undefined,
          throughputInfo
        };
    
        return { success: true, data: containerInfo };
      } catch (error: any) {
        console.error(`Error in mcp_container_info for container ${container_id}: ${error.message}`);
        return { success: false, error: error.message };
      }
    };
  • MCP tool metadata definition including name, description, and input schema for validation, used in ListTools response.
      name: "mcp_container_info",
      description: "Get detailed information about a specific container including throughput settings",
      inputSchema: {
        type: "object",
        properties: {
          container_id: {
            type: "string",
            description: "The ID of the container to analyze"
          }
        },
        required: ["container_id"]
      }
    },
  • TypeScript interface defining the structure of ContainerInfo data returned by the tool.
    export interface ContainerInfo {
      id: string;
      partitionKey?: {
        paths: string[];
        kind?: string;
      };
      throughput?: number;
      indexingPolicy?: any;
      etag?: string;
      timestamp?: Date;
    }
  • src/server.ts:97-99 (registration)
    Switch case in the MCP CallTool request handler that invokes the mcp_container_info tool handler.
    case 'mcp_container_info':
        result = await toolHandlers.mcp_container_info(input as any);
        break;
  • src/tools/index.ts:4-9 (registration)
    Re-export of the mcp_container_info handler function from containerAnalysis.ts, making it available for import in mcp-server.ts.
    export {
      mcp_list_databases,
      mcp_list_containers,
      mcp_container_info,
      mcp_container_stats
    } from './containerAnalysis.js';
Behavior2/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. While 'Get detailed information' implies a read-only operation, it doesn't specify authentication requirements, rate limits, error conditions, or what format the detailed information will be returned in. The mention of 'throughput settings' hints at some behavioral aspect but doesn't fully describe the tool's operational characteristics.

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 - a single sentence that efficiently communicates the core purpose. Every word earns its place: 'Get' (action), 'detailed information' (scope), 'about a specific container' (target), 'including throughput settings' (key feature). There's no wasted verbiage.

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?

For a single-parameter read operation with no output schema, the description provides adequate but minimal context. It specifies what information will be retrieved ('detailed information... including throughput settings') but doesn't describe the return format, potential errors, or how this differs from related container tools. Given the simplicity of the tool (1 parameter, no annotations), the description is complete enough but could be more comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, with the single parameter 'container_id' clearly documented as 'The ID of the container to analyze'. The description adds no additional parameter semantics beyond what the schema already provides, maintaining the baseline score appropriate for high schema coverage.

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 tool's purpose with a specific verb ('Get') and resource ('container'), specifying it provides 'detailed information' including 'throughput settings'. However, it doesn't explicitly differentiate from sibling tools like 'mcp_container_stats' or 'mcp_list_containers', which might offer related container information.

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. There are multiple sibling tools related to containers (mcp_container_stats, mcp_list_containers) and documents (mcp_get_document_by_id, mcp_get_documents), but no indication of when this specific container information tool is appropriate versus those other options.

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