Skip to main content
Glama
BrianDeacon

cosmosdb-mcp

by BrianDeacon

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
AZURE_COSMOS_KEYNoCosmos DB key to use instead of az login for data plane operations
AZURE_SUBSCRIPTION_IDNoUsed by cosmosdb_list_accounts if set

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
cosmosdb_list_accountsA

List all Azure Cosmos DB accounts in the current subscription.

The subscription is resolved automatically — first from the AZURE_SUBSCRIPTION_ID environment variable, then from the active 'az login' session. If neither is available, an error is returned with instructions.

cosmosdb_list_databasesA

List all databases in an Azure Cosmos DB account.

Returns a sorted JSON array of database names. The account can be given as a short name (e.g. my-cosmos-account) or as a full endpoint URL — the https:// prefix and .documents.azure.com:443/ suffix will be added automatically if missing.

cosmosdb_list_containersA

List all containers in a Cosmos DB database.

Returns a sorted JSON array of container names. The account can be given as a short name or full endpoint URL.

cosmosdb_get_container_infoA

Get metadata for a Cosmos DB container.

Returns partition key path, indexing policy, default TTL, unique key policy, and system properties (_self, _etag, _ts). The account can be given as a short name or full endpoint URL.

cosmosdb_query_itemsA

Run a SQL query against a Cosmos DB container and return results.

Uses Cosmos DB SQL API syntax, e.g.: SELECT * FROM c WHERE c.status = 'active' SELECT c.id, c.name FROM c ORDER BY c._ts DESC

max_items is capped at 1000. Cross-partition queries are enabled automatically. Use cosmosdb_query_items_to_file instead if the result set may be large.

cosmosdb_query_items_to_fileA

Run a SQL query against a Cosmos DB container and save results to a file.

Results are written to output_file as a JSON array. Only the item count is returned in context — use this variant when the result set may be large to avoid filling the context window. max_items is capped at 1000.

cosmosdb_count_itemsA

Count items in a Cosmos DB container, with an optional filter.

where accepts a SQL WHERE clause body (without the WHERE keyword), e.g.: c.status = 'active' c.createdAt > '2025-01-01'

If where is omitted, counts all items in the container. Returns a JSON object with a 'count' field.

cosmosdb_read_itemA

Read a single item from a Cosmos DB container by ID and partition key.

Returns the full item document as JSON. Both item_id and partition_key are required — Cosmos DB requires the partition key for efficient point reads.

cosmosdb_upsert_itemA

Insert or replace an item in a Cosmos DB container.

The item must include an 'id' field. If an item with the same id and partition key already exists it will be replaced; otherwise a new item is created. Returns the stored item document (including system fields) as JSON.

cosmosdb_delete_itemA

Delete an item from a Cosmos DB container.

THIS IS DESTRUCTIVE — the item cannot be recovered after deletion. Both item_id and partition_key are required.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/BrianDeacon/cosmosdb-mcp'

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