Skip to main content
Glama

cosmosdb_item_delete

Remove specific items from Azure Cosmos DB containers by providing container name, item ID, and partition key to manage database content.

Instructions

Delete 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 delete
partition_keyYesPartition key value for the item

Implementation Reference

  • The core handler logic for the cosmosdb_item_delete tool. It retrieves the container client and calls delete_item with the provided item_id and partition_key.
    elif name == "cosmosdb_item_delete":  # Renamed table to container
        container_client = database.get_container_client(
            arguments["container_name"]
        )
        container_client.delete_item(
            item=arguments["item_id"], partition_key=arguments["partition_key"]
        )
        response = {"item_id": arguments["item_id"], "deleted": True}
  • Defines the input schema, description, and name for the cosmosdb_item_delete tool, which is used for registration.
    Tool(
        name="cosmosdb_item_delete",  # Renamed table to container
        description="Delete 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 delete",
                },
                "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_delete, by returning the list from get_azure_tools() in response to list_tools requests.
    @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. It states the tool performs a deletion, which implies a destructive mutation, but doesn't mention critical aspects like whether the deletion is permanent, requires specific permissions, has rate limits, or returns confirmation. This leaves significant gaps for a destructive operation.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

For a destructive tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., permanence, permissions), output expectations, and usage context relative to siblings. Given the complexity of database operations, this minimal description doesn't provide enough guidance for safe and effective use.

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?

The description adds no parameter-specific information beyond what the input schema provides. Since schema description coverage is 100%, the baseline score is 3. The description doesn't explain parameter relationships (e.g., that 'partition_key' is required alongside 'item_id' for Cosmos DB operations) or provide usage examples.

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 ('Delete') and resource ('an item from a Cosmos DB container'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'cosmosdb_container_delete' or 'blob_delete', which would require mentioning the specific resource type (item vs. container vs. blob).

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_replace' for updates or 'cosmosdb_item_query' for finding items, nor does it specify prerequisites (e.g., needing to identify an item first) or exclusions (e.g., not for containers).

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