Skip to main content
Glama

set_working_memory

Save a key-value pair to the session's working memory for temporary state during a research pipeline, preserving intermediate results without indexing.

Instructions

Write a key/value pair to the current session's working memory.

Working memory is an ephemeral scratchpad — it persists for the session
but is not indexed for vector search. Use it for state that agents need
mid-pipeline (e.g. intermediate results, decisions made so far).

Args:
    session_id: Pipeline session ID from session_bootstrap().
    key: Variable name (e.g. 'current_article', 'user_intent').
    value: Value to store (any string, JSON, or text).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
keyYes
valueYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It mentions that working memory persists for the session and is not indexed for vector search, but lacks details on overwrite behavior, data size limits, or error conditions, which are important for a write operation.

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?

The description is concise and well-structured: a clear one-line summary, followed by an informative explanation of working memory, usage context, and parameter descriptions. It is front-loaded and every sentence adds value.

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

Completeness4/5

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

Given the tool's simplicity (3 parameters, no enums, output schema exists), the description covers purpose, parameters, and usage context adequately. However, it omits behavioral details like whether keys are overwritten, which could be important for an agent using it mid-pipeline.

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 description coverage is 0%, so the description compensates by explaining each parameter: session_id from session_bootstrap, key as a variable name like 'current_article', and value as any string/JSON/text. This adds meaningful context beyond the schema's type-only definitions, though the value description could be more precise.

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 clearly states the tool's action: 'Write a key/value pair to the current session's working memory.' It distinguishes from siblings like 'get_working_memory' by focusing on writing, and explains the concept of working memory, making the purpose unambiguous.

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?

The description provides explicit guidance on when to use this tool: 'Use it for state that agents need mid-pipeline (e.g. intermediate results, decisions made so far).' It contrasts with vector-indexed memories but does not explicitly compare to other sibling memory tools like 'add_memory_entry' or 'store_semantic_memory'.

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/SVerITG/Metis'

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