Skip to main content
Glama

Get memory context

get_memory_context
Read-onlyIdempotent

Pack a prompt with tiered memories: full working memory, summaries for contextual, keys for longterm, and filter episodic entries by location, task, or time.

Instructions

Get a context-optimized view of memories: full working memory, summaries for contextual, and keys only for longterm. Read-only. Filter episodic memories by where with location and task, which read the metadata.episode convention {location, task, outcome}, and by when with after and before, which bound memory_at exactly as search_memory does; entries carrying a metadata.recording come back with their recording links resolved. Use this to pack a prompt; use read_memory for one key, search_memory to filter by text or tags, and get_memory_tree for parent-child task graphs. Pass playbook_id as the UUID or GUID of the playbook this call should target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskNoOnly episodic memories from this task (metadata.episode.task)
afterNoInclusive lower bound on memory_at, with a timezone
beforeNoInclusive upper bound on memory_at, with a timezone
locationNoOnly episodic memories recorded at this place (metadata.episode.location)
max_itemsNoMaximum items per tier
expand_keysNoKeys to show full content regardless of tier
playbook_idYesUUID or GUID of the target playbook
tags_filterNoOnly include memories with these tags
include_tiersNoTiers to include (default: working, contextual)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
tiersYes
total_itemsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so safety is covered. The description still adds genuine behavioral context: the tier-specific return shape, that entries carrying metadata.recording return with resolved links, and that after/before bound memory_at exactly as search_memory does. It does not disclose pagination or size limits, keeping it shy of a 5.

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?

Purpose and read-only status are front-loaded, then filtering semantics, then sibling routing. It is dense but every sentence carries unique information (tier behavior, episode convention, time bounds, alternatives). Slightly long as one unbroken paragraph, which costs a point.

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 9 parameters, an output schema already present, and rich annotations, the description supplies everything else an agent needs: how tiers differ, how to filter, how to target the playbook, and how it relates to sibling memory tools. Nothing required for correct invocation is missing.

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 above-baseline credit by explaining the semantics the schema only names: the metadata.episode {location, task, outcome} convention behind location/task, and that after/before are exact memory_at bounds matching search_memory. playbook_id is also clarified as a UUID or GUID.

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?

Starts with a specific verb and resource ('Get a context-optimized view of memories') and immediately specifies the per-tier treatment (full working, summaries for contextual, keys only for longterm). It explicitly names the siblings it is not (read_memory, search_memory, get_memory_tree), so an agent can distinguish it without opening other schemas.

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?

Gives an explicit use case ('use this to pack a prompt') followed by a routing table to alternatives with their distinct conditions: read_memory for one key, search_memory to filter by text or tags, get_memory_tree for parent-child task graphs. This is exactly the when-to-use/when-not guidance the dimension asks for.

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