Skip to main content
Glama

edit_document

Destructive

Replace specific text in an Outline document by matching old strings with new ones. Supports batch edits and staged saves for large rewrites.

Instructions

    Edits a document using string-match replacement.

    Each edit finds a unique old_string in the document
    and replaces it with new_string. Edits are applied
    server-side — you never need to hold the full
    document in context.

    IMPORTANT: Batch all edits for a document into a
    single call when possible to minimize API calls.
    Each old_string must uniquely match one location in
    the document. Include surrounding context if needed
    to disambiguate.

    Edits are applied sequentially, so later edits can
    target text created by earlier edits in the same
    batch. If any edit fails, no changes are applied
    (all-or-nothing).

    By default (save=True), changes are pushed to
    Outline immediately. Set save=False to stage changes
    locally for large rewrites spanning multiple calls,
    then pass save=True on the final call to push all
    accumulated changes.

    Args:
        document_id: The document ID to edit
        edits: List of edits to apply
        save: If True (default), push changes to Outline
            immediately. If False, stage locally.

    Returns:
        Summary of edits applied and save status
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYes
editsYes
saveNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Adds behavioral details beyond annotations: server-side editing, sequential edits, all-or-nothing, and save staging. No contradiction with destructiveHint=true. Does not describe all edge cases.

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?

Well-structured with paragraphs. Slightly verbose but each sentence adds value. Front-loaded with core action.

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?

Given sibling tools (read, update, archive), output schema, and annotations, the description covers editing behavior fully. Return value summary is sufficient.

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?

Describes document_id, edits (list of DocumentEdit), and save with default. Explains old_string and new_string. Schema lacks descriptions for top-level props but $defs has some; description compensates.

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 edits a document via string-match replacement, specifying the verb, resource, and method. It distinguishes from siblings like update_document that likely modify metadata.

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?

Provides explicit guidance on batching edits, uniqueness of old_string, sequential application, all-or-nothing failure, and save=false for staging. Lacks explicit when-not-to-use, but context with siblings makes it clear.

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/Vortiago/mcp-outline'

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