Skip to main content
Glama
bruhsb
by bruhsb

paperclip_upsert_document

Idempotent

Create or update a document on an issue, with optimistic concurrency control using a base revision ID.

Instructions

Create or update an issue document. Send baseRevisionId for safe concurrent updates.

Args:

  • issueId: string — Issue ID or identifier (example: "PAP-42")

  • key: string — Document key (example: "plan")

  • title: string — Document title

  • body: string — Document body (markdown)

  • format: "markdown" (optional) — Document format (default: markdown)

  • baseRevisionId: string (optional) — Current revision ID from a prior get; omit on first create

Returns: Returns the updated document object: key, title, body, revisionId, updatedAt.

Examples:

  • Use when: writing or updating the implementation plan document on an issue mid-run

  • Don't use when: you want to delete a document — use paperclip_delete_document (board-only)

Error Handling:

  • 400: validation failure → check title and body are non-empty

  • 401: authentication failed → check PAPERCLIP_API_KEY

  • 404: issue not found → verify ID with paperclip_list_issues

  • 409: conflict — baseRevisionId mismatch → re-read with paperclip_get_document and retry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdYesIssue ID or identifier (e.g. PAP-22)
keyYesDocument key (e.g. `plan`)
titleYesDocument title
bodyYesDocument body (markdown)
formatNoDocument format (default: markdown)
baseRevisionIdNoCurrent revision ID for optimistic concurrency — omit on first create
Behavior5/5

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

Description explains safe concurrent updates via baseRevisionId, idempotent behavior (retry safety), and error handling for 400/401/404/409. Annotations already declare idempotentHint=true, which is consistent. No contradictions.

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?

Well-structured with clear sections (overview, Args, Returns, Examples, Error Handling). Each sentence adds value without redundancy. Length is appropriate for the tool's complexity.

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?

Despite no output schema, description specifies return fields (key, title, body, revisionId, updatedAt). Covers error scenarios and prerequisite actions (verify issue ID, re-read on conflict). Complete for a create/update tool.

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

Parameters5/5

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

Schema coverage is 100%, but description adds meaningful context: examples for issueId and key, explanation of optional format default, and detailed semantics of baseRevisionId for optimistic concurrency. This exceeds what the schema provides.

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 an issue document' with specific verbs and resource. It distinguishes from sibling tools by explicitly mentioning when not to use (paperclip_delete_document) and provides alternatives like paperclip_get_document for conflict resolution.

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

Usage Guidelines5/5

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

Provides explicit when-to-use (writing/updating implementation plan) and when-not-to-use (deleting). References sibling tools for alternative actions (paperclip_delete_document, paperclip_get_document, paperclip_list_issues). Includes guidance on baseRevisionId for first create vs update.

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/bruhsb/paperclip-mcp'

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