Skip to main content
Glama

batchStoreMemory

Store multiple memory records in a single atomic database transaction to reduce overhead when ending a session.

Instructions

Persist multiple memory units in a single atomic SQLite transaction. Significantly faster than calling storeMemory repeatedly for session-end writes of 10-20 memories.

WHEN TO CALL: At session end or whenever you have multiple memories to store at once. Reduces overhead from per-insert fsync by wrapping all writes in one transaction.

WHEN NOT TO CALL: For a single memory — use storeMemory instead. For imports from external files — use importMemories.

Each item in the memories array follows the same schema as storeMemory (memoryId, sessionId, sourceAdapter, kind, content, importance). Invalid items are reported individually; valid items are still stored atomically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memoriesYesArray of memory objects to store. Each must include: memoryId (unique UUID), sessionId, sourceAdapter, kind, content (self-contained text), importance (1-10). Minimum 1 item.
Behavior4/5

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

Beyond annotations (destructiveHint=false), description discloses atomic SQLite transaction, performance rationale, and error handling for invalid items. No contradictions. Lacks explicit statement of destructuring behavior but sufficient for a batch write.

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?

Well-structured with separate usage sections, front-loaded with key purpose. Every sentence provides value, no redundancy. Efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema; description partially addresses return behavior (invalid items reported individually) but does not specify full return format. For a simple tool with 1 parameter, it covers most needs but lacks output details.

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%, baseline 3. Description adds value by clarifying items follow same schema as storeMemory and explaining atomicity with error handling, but does not add novel parameter details.

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?

Description clearly states verb 'persist multiple memory units' and distinguishes from storeMemory by highlighting batch and speed advantage. Differentiates from siblings like storeMemory and importMemories.

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?

Explicit sections for 'WHEN TO CALL' (session end, multiple memories) and 'WHEN NOT TO CALL' (single memory → storeMemory, imports → importMemories). Provides clear decision guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/catfish-1234/sessionmem'

If you have feedback or need assistance with the MCP directory API, please join our Discord server