Skip to main content
Glama

Patch note preamble

patch_note_preamble
Destructive

Replace or delete a Markdown note's content before its first recognized heading, using an expected hash for safe updates. Refuses notes without a heading or with unclosed code fences.

Instructions

Use this to replace or remove content strictly before the first Markdown heading recognized by the current write selector. Pass the note's exact expected_hash for CAS. Empty or whitespace-only new_content removes the preamble. The first heading and all following content preserve exact bytes when the file uses uniform line endings; mixed-EOL files follow the existing global dominant-EOL normalization. Notes without a recognized Markdown heading are refused fail-closed, and so is content that leaves a code fence or HTML block open. The shared AST selector supports ATX and Setext headings, normalizes closing hashes, and ignores headings inside fenced code.

Input Schema

NameRequiredDescriptionDefault
rel_pathYes
request_idNo
new_contentYes
expected_hashYes

Output Schema

NameRequiredDescriptionDefault
indexedYes
patchedNo
rel_pathNo
replayedNo
committedNo
content_hashYes
operation_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.17
    • addedOutput schema / description
      Added value: +"Successful ``patch_note_preamble`` payload."
    • removedOutput schema / properties / committed / default
      Removed value: -null
    • removedOutput schema / properties / operation_id / default
      Removed value: -null
    • removedOutput schema / properties / patched / default
      Removed value: -null
    • removedOutput schema / properties / rel_path / default
      Removed value: -null
    • removedOutput schema / properties / replayed / default
      Removed value: -null
  2. Changed9 schema fields changedv0.1.5
    • addedInput schema / properties / request_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Request Id"
      +}
    • addedOutput schema / properties / committed
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Committed"
      +}
    • addedOutput schema / properties / operation_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Operation Id"
      +}
    • removedOutput schema / properties / patched / $ref
      Removed value: -"#/$defs/PatchedPreambleOutput"
    • addedOutput schema / properties / patched / anyOf
      Added value: +[
      +  {
      +    "$ref": "#/$defs/PatchedPreambleOutput"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedOutput schema / properties / patched / default
      Added value: +null
    • addedOutput schema / properties / rel_path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Rel Path"
      +}
    • addedOutput schema / properties / replayed
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Replayed"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "patched",
      -  "content_hash",
      -  "indexed"
      -]New value: +[
      +  "content_hash",
      +  "indexed"
      +]
  3. Addedv0.1.3

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=false, but the description adds substantial context beyond them: CAS via expected_hash, empty new_content removing the preamble, byte preservation under uniform line endings, dominant-EOL normalization for mixed files, and fail-closed refusal for missing headings or unbalanced code fences/HTML blocks.

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?

Front-loads the usage statement, then layers edge-case behavior in a tight sequence. Dense with mechanical detail but nearly every clause conveys a distinct constraint (CAS, removal semantics, EOL handling, refusal conditions), with little redundancy.

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?

Output schema exists, so return-value explanation is unnecessary, and annotations cover safety. For a destructive, non-idempotent mutation the description supplies the missing pieces an agent needs: concurrency control, failure modes, and byte/EOL preservation guarantees.

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 description coverage is 0%, so the description carries the burden: it explains new_content semantics (empty/whitespace removes the preamble) and expected_hash's CAS role. However, rel_path and request_id are left undocumented, so the compensation is partial.

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 (replace or remove) and a precisely scoped resource (content strictly before the first recognized Markdown heading). It clearly distinguishes itself from the sibling patch_note_section by scoping to the preamble, so an agent can tell them apart without opening schemas.

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?

Opens with an explicit use case ('Use this to replace or remove content strictly before the first Markdown heading...') and the selector scope makes it clear when this applies versus the section siblings. It does not explicitly name an alternative tool or a when-not condition, so it falls short of a 5.

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