Skip to main content
Glama

akb_edit

Replace exact text in a single document. Supports unique or multiple occurrences and concurrent edit detection.

Instructions

Edit a single document by replacing exact text. Scope is one document. old_string must be unique within the document (or use replace_all). If old_string is not found or appears multiple times, the call fails with a clear error. For find-and-replace across many documents, use akb_grep with replace instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriYesDocument URI
old_stringYesExact text to replace. Must be unique in the document body unless replace_all=true. Include surrounding context if needed for uniqueness.
new_stringYesReplacement text. Can be empty to delete.
replace_allNoReplace all occurrences (default: false, requires old_string to be unique)
messageNoCommit message describing the change
base_commitNoOptional OCC pin — when set, the edit is rejected if the document's current_commit moved. Use after akb_get to fail-fast on concurrent writers.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool fails if old_string is not found or appears multiple times (unless replace_all true), and mentions the OCC pin (base_commit) for concurrency control. It does not explicitly state that it permanently modifies the document, but the edit action implies mutation. Overall adequate without annotations.

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?

The description is four sentences long, all front-loaded. The first sentence gives the core action, the second clarifies scope, the third explains error conditions, and the fourth provides an alternative. Each sentence adds necessary information without redundancy.

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, no output schema, and no annotations, the description covers the tool's purpose, constraints, error handling, and usage boundaries. It could mention the return value (e.g., success indication), but the description is largely complete for an edit tool.

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 100%, and the description adds meaning beyond the schema: it explains the uniqueness requirement for old_string, the interaction with replace_all, that new_string can be empty to delete, and the purpose of base_commit for optimistic concurrency control. This enriches 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 that the tool edits a single document by replacing exact text, specifying the scope ('one document') and contrasting with multi-document tool akb_grep. The verb and resource are precise, distinguishing it from siblings like akb_put, akb_update, and akb_delete.

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 states when to use (single document exact-text replacement) and when not to ('For find-and-replace across many documents, use akb_grep with replace instead'). Also provides guidelines for unique old_string and replace_all behavior.

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/dnotitia/akb'

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