Skip to main content
Glama

write_memory

Persist hypotheses, fix logs, or pending work across sessions by creating or replacing one top-level value in reforge-state.json through a staged write.

Instructions

Create or replace one top-level value in reforge-state.json via a staged write. Use when: you need to persist a hypothesis, fix log or pending work across sessions. Don't use when: you only need to inspect a stored value (use read_memory instead).

Returns {success, key, previous_value}, with error on an OSError while saving. previous_value is null for an absent key or a previously null value. Repeated calls can change previous_value and rotate timestamped state backups, so this is not idempotent even when the supplied value is unchanged.

Input Schema

NameRequiredDescriptionDefault
keyYesTop-level state key to create or replace; arbitrary strings are accepted, e.g. pending_fixes. This is a literal key, not a dotted path.
valueYesRequired JSON value to store: object, array, string, number, boolean or null. Replaces the entire value at key rather than merging/appending. Example for pending_fixes: ['split handlers.py'].
repo_pathYesExisting directory containing reforge-state.json; prefer an absolute path. Writes through reforge-state.tmp, replaces the state file and rotates up to five timestamped backups; other top-level keys are preserved.

Output Schema

NameRequiredDescriptionDefault
keyYes
errorNo
successYes
previous_valueYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.4.5
    • addedInput schema / properties / key / description
      Added value: +"Top-level state key to create or replace; arbitrary strings are accepted, e.g. pending_fixes. This is a literal key, not a dotted path."
    • addedInput schema / properties / repo_path / description
      Added value: +"Existing directory containing reforge-state.json; prefer an absolute path. Writes through reforge-state.tmp, replaces the state file and rotates up to five timestamped backups; other top-level keys are preserved."
    • addedInput schema / properties / value / description
      Added value: +"Required JSON value to store: object, array, string, number, boolean or null. Replaces the entire value at key rather than merging/appending. Example for pending_fixes: ['split handlers.py']."
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / properties
      Added value: +{
      +  "error": {
      +    "type": "string"
      +  },
      +  "key": {
      +    "type": "string"
      +  },
      +  "previous_value": {},
      +  "success": {
      +    "type": "boolean"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "success",
      +  "key",
      +  "previous_value"
      +]
  2. Addedv0.2.9

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and idempotentHint=false; the description adds the reason behind the idempotency flag (backups rotate, previous_value changes on repeated calls) plus the OSError failure mode, which is genuinely useful context. It also clarifies that other top-level keys are preserved, easing the destructiveHint=false concern. Minor gap: the return-shape sentence partly duplicates the existing output schema.

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?

Front-loaded with the core action, then structured 'Use when' / 'Don't use when' blocks, then return and idempotency notes. Every sentence carries information; nothing is padding.

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?

For a three-parameter write tool with full schema coverage and an output schema, the description covers the remaining gaps an agent needs: side effects (backups, replacement semantics), failure mode, and non-idempotency. Nothing material is missing.

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 100% and the schema already documents key as a literal (not dotted) key, value as a full JSON replacement, and repo_path's temp-file/backup behavior. The description adds no parameter-level detail beyond what the schema states, so the baseline 3 applies.

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 and resource ('Create or replace one top-level value in reforge-state.json via a staged write') and scopes it to a single top-level key, which distinguishes it from read_memory and from other writers in the sibling list. An agent can tell what this does without opening the schema.

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?

Gives an explicit 'Use when' condition (persisting hypothesis, fix log or pending work across sessions) and an explicit 'Don't use when' with the named alternative (read_memory for inspection). Both the positive and negative routing conditions are stated.

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