Skip to main content
Glama

patch_memory_section

Update a single Markdown section in a memory note without altering frontmatter, other sections, or the Timeline audit trail. Replace or append content safely by targeting one heading.

Instructions

Surgically updates a Markdown section (e.g. '## Compiled Truth') in a memory note without modifying frontmatter, other sections, or the Timeline audit trail.

Args: memory_id: Target memory ID to patch. section: Section heading to replace or create (default 'Compiled Truth'). new_content: New Markdown text for the section. workspace_dir: Workspace root directory. scope: Lookup scope ('local' or 'global'). append: Whether to append to existing section content instead of replacing. origin: Optional provenance identifier '@'. Falls back to X-Agent-Id@X-Host session header or 'botex'.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "memory_id": "<memory_id>"
    },
    "name": "patch_memory_section"
  }
}

Input Schema

NameRequiredDescriptionDefault
scopeNolocal
appendNo
originNo
sectionNoCompiled Truth
memory_idYes
new_contentNo
workspace_dirNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.0
    • addedInput schema / properties / origin
      Added value: +{
      +  "default": "",
      +  "title": "Origin",
      +  "type": "string"
      +}
  2. Addedv1.1.2

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose real behavior: what is preserved (frontmatter, other sections, Timeline audit trail), the replace-vs-append distinction, that a missing section is created, and the origin provenance fallback chain through session headers to 'botex'. Gaps remain around failure modes for an unknown memory_id and any permission requirements.

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 single front-loaded sentence carries the most important information (the surgical, non-destructive scope) before the parameter list. The Args block is terse and non-redundant, though it slightly restates the schema's own parameter names and defaults.

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?

An output schema exists, so return values need not be explained, and all seven input parameters are accounted for in the description. For a non-destructive section-patcher of this complexity, an agent has enough to invoke it correctly without opening the schema.

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 0%, yet the Args block documents all seven parameters meaningfully — including the enum values for scope ('local' or 'global'), the default for section ('Compiled Truth'), the semantics of append, and the origin fallback chain, none of which appear in the bare schema titles. Minor shortfalls: workspace_dir is described only as "Workspace root directory" with no guidance on when to supply it versus relying on scope.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ("Surgically updates a Markdown section in a memory note") and bounds the blast radius explicitly ("without modifying frontmatter, other sections, or the Timeline audit trail"). That scope statement effectively separates it from a whole-note writer like save_memory, though no sibling is named outright.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: an agent can infer this tool is for editing one section in place instead of rewriting a whole note. There is no explicit when-to-use versus save_memory, no prerequisite (e.g. does the memory need to exist first), and no stated exclusions.

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