Skip to main content
Glama
BrianDeacon

cosmosdb-mcp

by BrianDeacon

cosmosdb_upsert_item

Insert or replace an item in a Cosmos DB container. The item's id and partition key determine whether to create or update.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYes
databaseYes
containerYes
itemYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses the 'id' requirement, upsert behavior, and return value (stored item with system fields). Missing details on partition key handling, error conditions, or permissions.

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?

Three sentences, front-loaded with the core action, no wasted words. Structure is logical: action, requirements, behavior, return value.

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 4 parameters with no schema descriptions and no annotations, the description covers the key points: required id field, upsert behavior, and output format. Does not discuss error handling or edge cases, but adequate for a simple operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 4 parameters with 0% description coverage. The description adds meaning by clarifying the 'item' parameter must include an 'id' field and that the partition key is considered. Other parameters are standard Cosmos DB identifiers.

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's purpose with a specific verb ('Insert or replace') and resource ('an item in a Cosmos DB container'). It distinguishes from sibling tools like cosmosdb_read_item (no replacement) and cosmosdb_delete_item.

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 explains when to use the tool: for items with an 'id' field, with replacement logic based on id and partition key. It does not explicitly list when not to use it or compare to siblings, but the behavior is clear.

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