Skip to main content
Glama

set_working_memory

Store intermediate results and decision state in session working memory for agents needing mid-pipeline context.

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, the description must disclose all behavioral traits. It clarifies ephemeral, session-scoped behavior and non-indexed nature, but omits side effects like overwriting existing keys, size limits, or error handling. Output schema existence may cover return values, but not mentioned.

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 with five sentences. It is front-loaded with the action, followed by purpose and parameter details in a clear, structured format. No wasted words.

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?

For a write tool with three required parameters, the description covers purpose, usage context, and parameter semantics. It lacks constraints on key length or value size, but output schema likely handles return values, making it reasonably complete.

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 descriptions are absent (0% coverage), but the description's 'Args' section adds meaning: session_id source, key as variable name, value as any text/JSON. This compensates well, though value format 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 'Write a key/value pair to the current session's working memory,' providing a specific verb and resource. It implicitly distinguishes from sibling 'get_working_memory' and other storage tools by focusing on write and ephemeral nature.

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 explains that working memory is ephemeral and for mid-pipeline state, contrasting with long-term searchable memory. It advises use cases like intermediate results, but does not explicitly name alternative tools or when not to use.

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_PH'

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