Skip to main content
Glama

cosmosdb_container_create

Create a Cosmos DB container using specified container name and partition key. Supports optional database name and integrates with Azure MCP Server for logging and audit tracking.

Instructions

Create a new Cosmos DB container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
container_nameYesName of the Cosmos DB container
database_nameNoName of the Cosmos DB database (optional, defaults to 'defaultdb')
partition_keyYesPartition key definition for the container (e.g., {'paths': ['/partitionKey'], 'kind': 'Hash'})

Implementation Reference

  • Executes the cosmosdb_container_create tool by calling database.create_container with the provided container_name and partition_key, returning a success response.
    if name == "cosmosdb_container_create": # Renamed from table to container container = database.create_container( id=arguments["container_name"], partition_key=arguments["partition_key"] ) response = {"container_id": container.id, "created": True}
  • Defines the input schema for the cosmosdb_container_create tool, specifying parameters like container_name, optional database_name, and required partition_key object.
    Tool( name="cosmosdb_container_create", # Renamed from table to container description="Create a new Cosmos DB container", # Updated description inputSchema={ "type": "object", "properties": { "container_name": { # Renamed from table_name "type": "string", "description": "Name of the Cosmos DB container", # Updated description }, "database_name": { "type": "string", "description": "Name of the Cosmos DB database (optional, defaults to 'defaultdb')", }, "partition_key": { "type": "object", "description": "Partition key definition for the container (e.g., {'paths': ['/partitionKey'], 'kind': 'Hash'})", }, }, "required": [ "container_name", "partition_key", ], # Partition key is usually required for Cosmos DB }, ),
  • Registers the cosmosdb_container_create tool (among others) by returning get_azure_tools() in the MCP server's list_tools decorator handler.
    @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

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