cosmosdb-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| AZURE_COSMOS_KEY | No | Cosmos DB key to use instead of az login for data plane operations | |
| AZURE_SUBSCRIPTION_ID | No | Used by cosmosdb_list_accounts if set |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 10 tools
Each tool targets a distinct resource or operation: count, delete, container info, account/database/container listing, query (with two variants for output), read, and upsert. No overlaps.
All tools follow a consistent 'cosmosdb_verb_noun' pattern in snake_case, e.g., list_databases, query_items, upsert_item. Even the longer query_items_to_file is internally consistent.
10 tools is well-scoped for a Cosmos DB server, covering listing, CRUD, query, and metadata operations without being excessive or sparse.
Covers account/database/container listing, item CRUD (read, upsert, delete), query, and count. Minor gap: no explicit update item, but upsert covers replacement. Overall solid for typical usage.