Skip to main content
Glama
BrianDeacon

cosmosdb-mcp

by BrianDeacon

cosmosdb_query_items

Run SQL queries against a Cosmos DB container to retrieve data, with a maximum of 1000 items. Cross-partition queries are enabled by default.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYes
databaseYes
containerYes
queryYes
max_itemsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that max_items is capped at 1000, cross-partition queries are enabled automatically, and the SQL syntax expected. These are key behavioral traits for a query tool. However, it does not mention error handling or response format, though an output schema likely covers the latter.

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 concise: three sentences plus a code block, with the purpose stated in the first sentence. It is front-loaded and every sentence adds value—purpose, examples, constraints, and alternative tool recommendation—with no unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, SQL queries) and the presence of an output schema, the description covers the key aspects: query syntax, result limit, cross-partition support, and alternative tool. It does not cover error scenarios or performance characteristics, but these are reasonable omissions for a query tool with an output schema.

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?

With 0% schema description coverage, the description adds meaning for two of five parameters: it explains query syntax and max_items cap (overriding default). Account, database, and container are not described, but their names are self-explanatory. The description does not fully compensate for the lack of schema descriptions, but adds enough value to meet baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs a SQL query against a Cosmos DB container and returns results, with examples of SQL syntax. It distinguishes itself from the sibling tool 'cosmosdb_query_items_to_file' by mentioning when to use that alternative, fulfilling the purpose clarity criterion fully.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when not to use this tool ('Use cosmosdb_query_items_to_file instead if the result set may be large'), but does not cover when to use it over other read-related siblings like 'cosmosdb_read_item'. The cross-partition automatic enablement is mentioned, providing useful context.

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

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