Skip to main content
Glama
hendrickcastro

MCP CosmosDB

mcp_upsert_document

Insert a new document or update an existing one in a CosmosDB container by specifying the container, document data, and partition key.

Instructions

Create or update a document in a CosmosDB container (upsert operation).

If a document with the same id and partition key exists, it will be replaced. If it doesn't exist, a new document will be created.

Example: mcp_upsert_document({ container_id: 'users', document: {id: 'user-456', email: 'test@example.com', lastUpdated: '2024-01-15'}, partition_key: 'user-456', connection_id: 'athlete' })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
container_idYesThe ID/name of the container
documentYesThe document to create or update. Must include 'id' field and the partition key field.
partition_keyYesThe partition key value for the document
connection_idNoID of the connection to use. Use mcp_list_connections to see available connections. If not specified, uses the default connection.
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 upsert behavior: 'If a document with the same id and partition key exists, it will be replaced. If it doesn't exist, a new document will be created.' This is adequate but lacks details on side effects, permissions, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise: two sentences of explanation plus an example. The first sentence states the purpose immediately. The example is useful without being verbose. Every sentence contributes 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 no output schema and a nested object parameter, the description explains the upsert semantics and provides an example. It does not describe return values or error handling, but for a basic upsert operation, the coverage is sufficient.

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?

Schema coverage is 100%, setting baseline at 3. The description adds an example that demonstrates parameter usage, such as matching partition_key to id, providing practical context beyond the schema's property descriptions.

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 'Create or update a document in a CosmosDB container (upsert operation)', specifying the verb (upsert) and resource (document in CosmosDB). It differentiates from siblings like mcp_create_document and mcp_update_document by clarifying the upsert behavior.

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: to create or update a document, with conditional behavior based on existence. It provides context but does not explicitly exclude alternatives (e.g., when to use create or update separately), though the implied logic is clear given sibling tools.

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/hendrickcastro/MCPCosmosDB'

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