Skip to main content
Glama

cosmosdb_item_read

Retrieve a specific item from an Azure Cosmos DB container by providing its ID and partition key. Use this tool to access stored data for processing or analysis.

Instructions

Read an item from a 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')
item_idYesID of the item to read
partition_keyYesPartition key value for the item

Implementation Reference

  • Executes the cosmosdb_item_read tool by getting the container client and calling read_item with item_id and partition_key.
        name == "cosmosdb_item_read"
    ):  # Renamed from get to read, and table to container
        container_client = database.get_container_client(
            arguments["container_name"]
        )
        item = container_client.read_item(
            item=arguments["item_id"], partition_key=arguments["partition_key"]
        )
        response = item
  • Defines the input schema and metadata for the cosmosdb_item_read tool.
    Tool(
        name="cosmosdb_item_read",  # Renamed from get to read, and table to container
        description="Read an item from a 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')",
                },
                "item_id": {
                    "type": "string",
                    "description": "ID of the item to read",
                },
                "partition_key": {
                    "type": "string",
                    "description": "Partition key value for the item",
                },
            },
            "required": ["container_name", "item_id", "partition_key"],
        },
    ),
  • Registers all Azure tools, including cosmosdb_item_read, by returning the list from 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
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Read' implies a read-only operation, it doesn't specify important behavioral traits such as authentication requirements, error handling (e.g., what happens if the item doesn't exist), rate limits, or whether this is a safe operation. The description is too minimal to adequately inform the agent about how this tool behaves in practice.

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 a single, clear sentence that efficiently communicates the core purpose without any wasted words. It's appropriately sized for a simple read operation and front-loads the essential information.

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

Completeness2/5

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

Given that this is a database operation with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format the returned item will be in (e.g., JSON document), whether it includes metadata, or what happens on errors. For a tool interacting with a complex system like Cosmos DB, more context is needed for the agent to use it effectively.

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?

Schema description coverage is 100%, so all parameters are documented in the input schema. The description adds no additional semantic context about the parameters beyond what's already in the schema (e.g., it doesn't explain relationships between parameters like why both item_id and partition_key are required). This meets the baseline expectation when schema coverage is high.

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

Purpose4/5

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

The description clearly states the action ('Read') and resource ('an item from a Cosmos DB container'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'cosmosdb_item_query' or 'cosmosdb_container_describe', which also involve reading data from Cosmos DB but with different approaches.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'cosmosdb_item_query' (for querying multiple items) or 'cosmosdb_container_describe' (for container metadata), leaving the agent to guess based on tool names alone. No explicit when/when-not instructions are provided.

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

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