Skip to main content
Glama

cosmosdb_container_list

Retrieve a list of all Cosmos DB containers within a specified database using the Azure MCP Server. Simplify container management and auditing for efficient database operations.

Instructions

List all Cosmos DB containers in a database

Input Schema

NameRequiredDescriptionDefault
database_nameNoName of the Cosmos DB database (optional, defaults to 'defaultdb')

Input Schema (JSON Schema)

{ "properties": { "database_name": { "description": "Name of the Cosmos DB database (optional, defaults to 'defaultdb')", "type": "string" } }, "type": "object" }

Implementation Reference

  • Core execution logic for the cosmosdb_container_list tool: lists containers in the database using CosmosClient and returns their names.
    elif name == "cosmosdb_container_list": # Renamed from table to container containers = list(database.list_containers()) container_names = [c["id"] for c in containers] response = {"container_names": container_names}
  • Input schema definition for the cosmosdb_container_list tool, including optional database_name parameter.
    Tool( name="cosmosdb_container_list", # Renamed from table to container description="List all Cosmos DB containers in a database", # Updated description inputSchema={ "type": "object", "properties": { "database_name": { "type": "string", "description": "Name of the Cosmos DB database (optional, defaults to 'defaultdb')", } }, }, ),
  • Registers all Azure tools including cosmosdb_container_list via the MCP server's list_tools handler by calling get_azure_tools().
    @server.list_tools() async def list_tools() -> list[Tool]: """List available Azure tools""" logger.debug("Handling list_tools request") return get_azure_tools() # Use get_azure_tools
  • Dispatches calls to cosmosdb_container_list (and other cosmosdb tools) to the appropriate handler function.
    elif name.startswith("cosmosdb_"): # Updated prefix to cosmosdb_ return await handle_cosmosdb_operations( azure_rm, name, arguments ) # Use cosmosdb handler

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/mashriram/azure_mcp_server'

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