Skip to main content
Glama

doc_open

Start a document-editing session by backing up the .docx into its .doc-control store, logging undo history if changed, and returning the backup path before edits.

Instructions

Start a session on a document: back it up into its store (.doc-control// next to it; the newest 20 backups or 30 days are kept) and note it in the undo log if it changed since the last logged write. Call it once before editing; the document itself is not changed. If the document has no history yet, adoptable lists orphaned stores (it was moved or renamed) that history.adopt can re-attach. Returns the backup path, the log entry and the store folder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docYesPath to the .docx.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesAlways true on success.
opYesThe operation that ran.
apiYesAPI version (1.0).
docNoThe document read or written: path, sha256 and paragraph count.
nextYesCursor for the next page (pass as cursor), or null.
resultYesWhat the operation returns.
warningsYesThings to know about the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.2
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "api": {
      +      "description": "API version (1.0).",
      +      "type": "string"
      +    },
      +    "doc": {
      +      "description": "The document read or written: path, sha256 and paragraph count.",
      +      "properties": {
      +        "characters": {
      +          "description": "text.normalize of a text string: its length.",
      +          "type": "integer"
      +        },
      +        "paragraphs": {
      +          "description": "Body paragraphs.",
      +          "type": "integer"
      +        },
      +        "path": {
      +          "description": "Path of the document.",
      +          "type": "string"
      +        },
      +        "sha256": {
      +          "description": "sha256 of the file (pass as expect.sha256 to a write).",
      +          "type": "string"
      +        },
      +        "source": {
      +          "description": "A .txt/.md/.odt source's format, encoding and split mode; \"text\" for a text string (text.normalize).",
      +          "type": [
      +            "object",
      +            "string"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "next": {
      +      "description": "Cursor for the next page (pass as cursor), or null.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ok": {
      +      "description": "Always true on success.",
      +      "type": "boolean"
      +    },
      +    "op": {
      +      "description": "The operation that ran.",
      +      "type": "string"
      +    },
      +    "result": {
      +      "description": "What the operation returns.",
      +      "properties": {
      +        "adoptable": {
      +          "description": "Orphan stores whose history this document could take back (history.adopt).",
      +          "items": {
      +            "description": "An orphan store.",
      +            "properties": {
      +              "doc": {
      +                "description": "Path of the document it last recorded.",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "doc_id": {
      +                "description": "Id of that document's history, null when unknown.",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "entries": {
      +                "description": "Log entries.",
      +                "type": "integer"
      +              },
      +              "last_time": {
      +                "description": "Time of the last entry (ISO 8601).",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "sha_matched": {
      +                "description": "Its last recorded state is this file.",
      +                "type": "boolean"
      +              },
      +              "store": {
      +                "description": "Store folder.",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "backup": {
      +          "description": "Path of the backup just taken.",
      +          "type": "string"
      +        },
      +        "hint": {
      +          "description": "What to do with adoptable.",
      +          "type": "string"
      +        },
      +        "op_id": {
      +          "description": "Log entry noting the open, or null if the file is as last logged.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "store": {
      +          "description": "The document's store folder (backups and log).",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "backup",
      +        "op_id",
      +        "store"
      +      ],
      +      "type": "object"
      +    },
      +    "warnings": {
      +      "description": "Things to know about the result.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "api",
      +    "ok",
      +    "op",
      +    "result",
      +    "warnings",
      +    "next"
      +  ],
      +  "type": "object"
      +}
  2. Addedv0.1.3

TDQS

A4.7/5.0
Behavior5/5

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

Richly discloses side effects that annotations do not cover: backup location (.doc-control/<file name>/), retention policy (20 backups or 30 days kept), undo-log behavior, and that the document is not modified. With destructiveHint=false and readOnlyHint=false, the description meaningfully explains what the tool actually does behind the scenes.

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?

Dense but front-loaded: starts with the core action, parenthetically provides backup mechanics, then the adoption edge case, then the return shape. No fluff; every clause carries 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?

Given an output schema exists, the description still helpfully names what is returned (backup path, log entry, store folder) and explains the adoption route. For a single-param tool with output schema and annotations, this is thorough.

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 single param 'doc' is documented as 'Path to the .docx.' The description's mention of orphaned stores and adoptable adds contextual meaning about output, though not about the parameter itself.

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?

States a specific verb (start a session) on a specific resource (a document), and explicitly clarifies the counterintuitive behavior: 'the document itself is not changed' and 'Call it once before editing'. This distinguishes it from doc_batch, doc_compare, and live_open without ambiguity.

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 clear timing guidance ('Call it once before editing') and conditional logic ('If the document has no history yet...'), routing the agent to history.adopt. It stops short of explicitly naming when NOT to use it vs. siblings like live_open or doc_diff.

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