Skip to main content
Glama

Replace a pad

set_document
DestructiveIdempotent

Replace the entire content of a pad. For non-empty pads, confirm by first requesting a token, then calling again with that token.

Instructions

Replaces the entire content of a pad. Replacing a non-empty pad requires confirmation: call once to receive a token, then again with that token. For targeted changes prefer replace_in_document, which leaves concurrent edits elsewhere in the pad intact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesId of the pad, the part after # in its URL
textYesPlain text content (up to 256 KiB, the Rustpad document limit)
confirm_tokenNoConfirmation token from a previous call of this tool with the same arguments. Omit on the first call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
urlYesShareable; anyone with it can read and edit.
noteYes
changedYesFalse when the pad already held exactly this content.
charactersYesLength of the pad after the write, in codepoints.
characters_beforeYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed3 schema fields changedv0.4.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / confirm_token / maxLength
      Added value: +64
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "changed": {
      +      "description": "False when the pad already held exactly this content.",
      +      "type": "boolean"
      +    },
      +    "characters": {
      +      "description": "Length of the pad after the write, in codepoints.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "characters_before": {
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "url": {
      +      "description": "Shareable; anyone with it can read and edit.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "url",
      +    "characters",
      +    "note",
      +    "characters_before",
      +    "changed"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.1

TDQS

A4.7/5.0
Behavior4/5

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

The description transparently mentions the confirmation requirement for non-empty pads and implies destructive behavior by stating it replaces entire content. The destructive annotation is not contradicted, but the description could have explicitly stated the idempotency aspect covered in annotations.

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?

Two concise sentences convey the core action, confirmation logic, and alternative recommendation with no redundant information.

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 destructive tool with a confirmation mechanism, the description adequately covers the necessary workflow and points to the alternative for targeted edits. The presence of an output schema means return values need not be described.

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 schema fully describes id, text, and confirm_token with individual descriptions. The description adds meaningful context for confirm_token by explaining its role in the confirmation flow, though it does not restate parameter details already in the 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 the tool's primary action ('Replaces the entire content of a pad') and distinguishes it from the alternative tool replace_in_document, making the purpose unambiguous.

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?

Explicitly instructs when to use this tool versus replace_in_document and clearly explains the two-step confirmation process for non-empty pads ('call once to receive a token, then again with that token').

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

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/ni-c/rustpad-mcp'

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