Skip to main content
Glama
JeanExtreme002

PyMemoryEditor

Official

write_value

DestructiveIdempotent

Write a typed value to a memory address in a running process and return the previous value, so you can undo the change by writing that value back.

Instructions

Write a value to an address. Absent when the server is --read-only.

The previous value is read first and returned as previous_value, so the change is reversible: to undo, call this again with that value. Nothing else in this server can put it back.

:param address: hex string, e.g. "0x7FFD1234". :param value_type: int, float, bool, str or bytes. :param value: the value to write. Hex for bytes. :param bufflength: for numbers, the exact write width — 1, 2, 4 or 8 for int, 4 or 8 for float, 1 for bool.

For ``bytes`` it is a maximum number of bytes, which truncates and
never pads. For ``str`` it caps **characters**, not bytes, so
non-ASCII text can overwrite more bytes than the number you pass:
``bufflength=2`` with ``"日本語"`` writes ``"日本"`` — six bytes.
The result's ``previous_value_bufflength`` always reports the span
that was actually replaced, so check it rather than assuming.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYes
addressYes
bufflengthNo
session_idYes
value_typeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, and idempotentHint=true, so the safety bar is lower. The description adds vital context: previous value is read and returned as previous_value, and 'Nothing else in this server can put it back,' which is critical for an agent making destructive writes. It could go further on permission or failure behavior.

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?

Information-dense but front-loaded: reversibility and availability appear first, then parameter details. The unicode example is slightly verbose but earns its place by illustrating a non-obvious edge case. No filler sentences.

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?

With an output schema present, the description correctly avoids detailing return values, but still tells the agent that previous_value and previous_value_bufflength are returned, which matters for reversing the write. It covers the destructive nature, the read-only mode, and all parameter quirks. Complete for a low-level memory-write tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It defines address format (hex), valid value_type values, bufflength semantics per type (write width for numbers, max bytes truncating for bytes, character cap for str), and includes a concrete unicode hazard example. This is far beyond a baseline and fills all gaps.

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+resource ('Write a value to an address') with a clear scope, and the read-back semantics distinguish it from read_value. The context note 'Absent when the server is --read-only' also clarifies availability.

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?

Explicitly describes the reversibility mechanism and instructs how to undo ('call this again with that value'), and references the read-only mode constraint. However, it does not mention read_value or scan_value as alternatives for reading, so no sibling routing beyond the implicit inverse.

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