Skip to main content
Glama

memory.fetch_context

Retrieve a ranked Markdown context pack from project memory, including current task state and conventions. Use before reading source files to prioritize relevant sections.

Instructions

Return a budgeted, ranked Markdown context pack assembled from the project's .agent-memory/ files. Call this before reading source files manually; the pack contains current task state, conventions, and any sections relevant to the query. An empty query returns the bootstrap pack (local current state + conventions + index summary).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNosearch query; empty returns the bootstrap pack
scopeNopaths or module names to prioritize via substring match
budgetNoapproximate character budget for the returned pack; 0 uses manifest default
includeNocontext categories to include (advisory in M2; M3 enforces)
exclude_archiveNoif true, archive/ files are skipped entirely; defaults to false

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextYesthe Markdown context pack
included_filesYesper-file provenance for everything in the pack
omittedNocandidates that were dropped (budget exhausted, parse error, etc.)
suggested_next_queriesNo
context_metadataYes
Behavior4/5

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

No annotations provided, so description fully shoulders transparency. Describes assembly from .agent-memory/ files, budgeted nature, and ranking. It also details parameter behaviors like scope substring matching and include/exclude. Does not explicitly state read-only or permissions, but the read operation is implied.

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?

Two concise sentences plus a clause for empty query. Every sentence is necessary, front-loads the primary action, and provides essential context without redundancy.

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?

Given the complexity of 5 optional parameters and an output schema (present but not detailed), the description covers all necessary aspects: what the tool does, when to use it, and parameter interactions. No obvious gaps for a fetch operation.

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%, baseline 3. Description adds context beyond schema: explains empty query results in bootstrap pack, budget 0 uses default, include is advisory in M2, and exclude_archive defaults to false. This enriches parameter understanding.

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?

Clearly states it returns a budgeted, ranked Markdown context pack from .agent-memory/ files. Distinct from siblings memory.propose_update and memory.status by its focus on context retrieval. Verb 'return' and resource 'context pack' are specific.

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?

Explicitly guides agents to call this before reading source files manually, providing clear context for use. Explains empty query returns bootstrap pack. Lacks direct comparison to siblings or when not to use, but the guidance is strong.

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/xChuCx/agent-memory'

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