Skip to main content
Glama

Upsert Many

upsert_many

Create or update up to 25 documents in one call.

Each item accepts doc_key, content, title, frontmatter, expected_version,
namespace, agent and session_batch_id. atomic=true: if any item fails the
whole batch rolls back and the error names failed_indexes; atomic=false:
each item succeeds or fails on its own. The default is atomic=false under
API 2026-11 and all-or-nothing before it. results[] has one entry per item
in order (ok, version, content_hash, noop, or error) with succeeded/failed
counts. Up to 25 items and 4 MiB of content (413 batch_too_large); a
document twice in one batch is 422 duplicate_key_in_batch.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "items": "<items>"
    },
    "name": "upsert_many"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYes
atomicNo
idempotency_keyNoOptional. Retries with the same key and arguments within 24 h replay the first result (replayed=true) without a second write; a different body with the same key is idempotency_key_reused.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false), the description discloses rollback semantics for atomic=true, per-item independence for atomic=false, the version-dependent default, and the specific error codes (413 batch_too_large, 422 duplicate_key_in_batch). This is exactly the behavioral context annotations cannot carry.

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?

Front-loaded with the core action and size limit, then organized by atomicity, then by result shape and error conditions. Dense but every clause carries information; the results[] sentence is slightly redundant given the output schema exists.

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

Completeness5/5

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

For a batch mutation tool with a thin schema, the description covers size limits, atomicity modes, default behavior across API versions, per-item result ordering, and failure codes. An agent has everything needed to call it correctly and interpret the outcome.

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 only 33% and the items array is an untyped object with no field documentation, so the description's enumeration of the eight accepted item fields (doc_key, content, title, frontmatter, expected_version, namespace, agent, session_batch_id) is essential and well beyond the schema. The atomic flag's dual default is also clarified; idempotency_key is left to the schema, which already documents it.

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 opening sentence gives a specific verb pair and resource ('Create or update ... documents') plus the batch bound of 25, which is far more than a restatement of the name. It does not, however, distinguish itself from the sibling upsert_shared_doc, so an agent must infer the difference from the name alone.

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

Usage Guidelines3/5

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

Usage is implied through the batch limits and the atomic flag semantics, which tell the agent when all-or-nothing behavior is appropriate. There is no explicit statement of when to prefer this over upsert_shared_doc or the generic batch tool, and no prerequisites are named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.