Skip to main content
Glama

upsert_document

Create or update a document by stable id. Idempotent: no action on unchanged content; changes append revision with additive tags.

Instructions

Create or update a document in your workspace by stable id — the write half of agent memory. Idempotent: unchanged content writes nothing (outcome "unchanged", no new revision); real changes append a revision to the tamper-evident history. Tags merge additively. Requires an authenticated bm_ key with write access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesStable document id (lowercase slug: a-z, 0-9, hyphens)
bodyYesDocument body (markdown or plain text)
tagsNoOptional tags — merged additively with any existing tags
typeNoOptional document type (concept, feature, experience, principle, note, policy); defaults to note
linksNoOptional outbound document-id links
titleYesDocument title
Behavior4/5

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

With no annotations, the description carries full burden. It discloses idempotency, revision history, tag merging behavior, and auth requirements. It does not cover error states or response format, but covers key behavioral traits well.

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, no fluff, front-loaded with purpose. Every sentence adds 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 6 parameters and no output schema, the description covers behavioral aspects (idempotency, tag merging, auth) quite well. It lacks return value details but that is partly excused by lacking output schema.

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%, so the schema already documents parameters. The description adds general context (tags merge additively) but does not improve per-parameter understanding beyond schema.

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' as the verb+resource, and positions it as 'the write half of agent memory', which distinctly contrasts with the sibling tools 'search' and 'get_context_pack'.

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 explicitly notes this is for write operations and mentions auth requirements. While it doesn't directly say when not to use it, the context of it being the write half versus read siblings provides clear usage guidance.

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/basemouse/basemouse-core'

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