Skip to main content
Glama

Search and replace in a pad

replace_in_document
Destructive

Replace an exact string in a collaborative pad with another string while preserving concurrent edits from other users. Set replace_all to change every occurrence or require a single unique match by default.

Instructions

Replaces an exact string in a pad with another. Only the matched ranges are edited, so concurrent edits elsewhere in the pad survive. By default the search string must match exactly once; set replace_all to change every occurrence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesId of the pad, the part after # in its URL
searchYesExact string to find (no regex)
replaceYesReplacement; may be empty to delete the match
replace_allNoReplace every occurrence instead of requiring a unique match
Behavior4/5

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

Annotations already mark this as mutable (readOnlyHint=false) and destructive (destructiveHint=true). The description adds unique behavioral context: 'Only the matched ranges are edited, so concurrent edits elsewhere in the pad survive,' clarifying the partial update strategy. It also confirms the search is exact (no regex). This goes beyond what annotations provide and is useful for agent reasoning.

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 total, each adding distinct value: purpose, concurrency behavior, and parameter default. No filler words. The information is front-loaded with the primary action. Every sentence earns its place, making it easy to scan.

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?

For a 4-parameter replacement tool with no output schema, the description covers the key behaviors: exact match, partial edit, uniqueness default, and replace_all alternative. It does not mention error cases (e.g., no match, multiple matches without replace_all) or return value, but given annotations handle safety signals, it is sufficiently complete. A minor gap is the absence of concurrency or lock warnings, but the concurrent edit statement partially addresses this.

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 coverage is 100%, so each parameter already has a description. The tool description reinforces the meaning of 'search' (exact string), 'replace' (may be empty), and 'replace_all' (default single-match). The additional context about default uniqueness is helpful but does not greatly extend beyond the schema. Baseline is 3, and description marginally meets it.

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 starts with 'Replaces an exact string in a pad with another,' using a specific verb ('replaces') and resource ('string in a pad'). It clearly distinguishes from siblings like set_document (full overwrite) and append_to_document (append), leaving no ambiguity about its targeted edit function.

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 states 'By default the search string must match exactly once; set replace_all to change every occurrence,' which guides when to use the boolean parameter. It implies this tool is for exact string replacement, not regex or whole-document replacement, but does not explicitly name sibling alternatives for contrast. Context is clear enough for an agent to decide.

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

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