Skip to main content
Glama

Stash — Shared AI Memory

Write many memories

batch_write

Store many memory entries in one atomic call. Use this whenever you have 3 or more things to write — it is faster, atomic, and ensures nothing is lost if the session ends unexpectedly. Entries can go to one namespace (top-level path) or to different namespaces (a path on each item). Every item needs a namespace: there is no default, so pass a top-level path or a path on every item — batch_write({path: "/projects/", contents: [...]}) — and pass "/" explicitly to write to the root. Every namespace must exist first (call mkns). Returns a UUID per entry. Prefer this over multiple sequential write calls.

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": {
      "contents": "<contents>"
    },
    "name": "batch_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoNamespace for all items that don't set their own path. Must already exist. Required unless every item has its own path (or 'namespace' is given instead). There is no default: pass "/" explicitly to write to the root.
contentsYesItems to store, max 50. Each item is either a string (stored in the top-level path) or an object {"content": "...", "path": "/some/namespace"}. Each item becomes a separate entry.
namespaceNoAlias for 'path'.

Output Schema

NameRequiredDescriptionDefault
brainYes
entriesYes
next_actionsNo
total_tokensYes
namespace_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, yet the description adds real value: atomicity ("atomic, and ensures nothing is lost if the session ends unexpectedly"), a per-entry UUID return, and the failure-inducing prerequisite that namespaces must pre-exist. It stops short of stating what happens to the batch on partial failure or how it behaves under the declared idempotentHint=false (e.g., duplicate handling), leaving one meaningful gap.

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?

It is front-loaded with the atomic-batch benefit and the 3+ heuristic before the mechanics, and every sentence carries operational content. There is mild redundancy in restating the no-default namespace rule twice ("Every item needs a namespace: there is no default..." then the explicit "/" note), which keeps it just under full marks.

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 3-parameter write tool, the description covers invocation pattern, prerequisites, batching threshold, and atomicity, while the output schema and the per-entry UUID mention handle return values. An agent has everything needed to call this correctly on the first attempt.

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%, so the baseline is 3, but the description earns more by explaining the routing model in prose — one top-level `path` for all items versus a per-item path, the absolute requirement that every item resolve to a namespace, and the "pass \"/\" explicitly to write to the root" rule with a concrete call shape.

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?

The description opens with a specific verb and resource ("Store many memory entries in one atomic call") and frames itself against the sequential-write alternative with "Prefer this over multiple sequential write calls," which distinguishes it from the `write` sibling without needing 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?

It gives an explicit decision threshold ("whenever you have 3 or more things to write"), names the preferred alternative (multiple sequential `write` calls), and states a hard prerequisite with a named sibling tool ("Every namespace must exist first (call mkns)"). When-to-use, when-not-to-use, and dependencies are all present.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources