Skip to main content
Glama

cosmosdb_item_create

Add new items to Azure Cosmos DB containers by specifying container name and JSON data. This tool enables data insertion into NoSQL databases for application storage needs.

Instructions

Create a new item in 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')
itemYesItem data to create (JSON object)

Implementation Reference

  • Handler logic for the cosmosdb_item_create tool: retrieves the container client and creates a new item using create_item, returning the item ID and success status.
    elif (
        name == "cosmosdb_item_create"
    ):  # Renamed from put to create, and table to container
        container_client = database.get_container_client(
            arguments["container_name"]
        )
        item = container_client.create_item(body=arguments["item"])
        response = {"item_id": item["id"], "created": True}
  • Tool schema definition for cosmosdb_item_create, specifying input parameters: container_name, optional database_name, and item object.
    Tool(
        name="cosmosdb_item_create",  # Renamed from put to create, and table to container
        description="Create a new item in 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": {
                    "type": "object",
                    "description": "Item data to create (JSON object)",
                },
            },
            "required": ["container_name", "item"],
        },
    ),
  • Tool registration via the list_tools handler, which returns all Azure tools including cosmosdb_item_create 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 full burden for behavioral disclosure. It states 'Create' implying a write operation but doesn't cover critical aspects like authentication needs, error handling (e.g., conflicts), rate limits, or what happens on success (e.g., returns created item ID). For a mutation tool, this is a significant gap in transparency.

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 front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, with no redundancy or fluff.

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 the tool's complexity (mutation with 3 parameters, no output schema, and no annotations), the description is incomplete. It lacks information on return values, error conditions, prerequisites (e.g., container must exist), and behavioral traits like idempotency. For a database write operation, this leaves too many unknowns for reliable agent 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?

Schema description coverage is 100%, with clear descriptions for all parameters (container_name, database_name, item). The description adds no additional parameter semantics beyond what's in the schema, such as format details for 'item' or constraints on names. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Create') and target resource ('new item in a Cosmos DB container'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like cosmosdb_item_replace or cosmosdb_item_query, which would require more specific language about creating versus updating or querying items.

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 prerequisites (e.g., existing container/database), contrast with siblings like cosmosdb_item_replace for updates, or specify use cases (e.g., initial data insertion). This leaves the agent without context for tool selection.

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