Skip to main content
Glama

memory.fetch_context

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

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 carries full burden. It discloses key behaviors: budgeted, ranked, Markdown output, bootstrap pack for empty query. Would benefit from mentioning auth or failure modes, but is adequate.

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 sentences, no waste. Front-loaded with purpose, followed by usage guidance. Efficient and direct.

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 5 parameters and output schema exists, description covers purpose, usage, and parameter behavior. Lacks error handling details but is sufficient for the tool's role.

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?

Input schema covers all 5 parameters with descriptions (100% coverage). Description adds context like 'empty returns bootstrap pack' for query and 'approximate character budget' for budget, but mostly reinforces schema info.

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. Distinguishes from siblings (propose_update, status) which are different operations.

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 advises calling before reading source files manually, and explains empty query returns bootstrap pack. Lacks explicit when-not-to-use or alternatives, but guidance is clear.

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