Skip to main content
Glama
@memoryrelay/mcp-server

@memoryrelay/mcp-server

Official
by memoryrelay

memory_context

Builds a formatted context block from ranked memories relevant to a query, so you can insert one prompt-ready context string instead of assembling search results manually.

Instructions

Build a formatted context string from relevant memories for a given query. Returns ranked memories with similarity scores, ready for use in prompts. More convenient than memory_search when you need a single context block.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "memory_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of memories to include (1-50)
queryYesNatural language query to find relevant memories
thresholdNoMinimum similarity threshold (0-1)
max_tokensNoMaximum token budget for the context string. Results are truncated to fit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the whole burden. It discloses the output shape (ranked memories plus similarity scores, formatted for prompts) and implies read-only behavior, but never states whether it persists or logs anything, how ranking is computed, or what the string looks like. Useful but incomplete for an unannotated tool.

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?

Three short sentences, front-loaded with the core action, then the return shape, then the sibling comparison. Nothing is redundant or padded.

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?

There is no output schema, so the description correctly spells out what comes back: ranked memories with similarity scores in a formatted string. Given all four parameters are schema-documented, the only real gap is side-effect/read-only disclosure and the actual format of the context block.

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?

Schema description coverage is 100%, so limit, threshold, and max_tokens are already documented in the schema, including the truncation behavior. The description adds no syntax, defaults, or interaction details (e.g., how threshold and limit interact), so the baseline 3 is correct.

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 opens with a specific verb and artifact — 'Build a formatted context string from relevant memories' — and scopes it to a query. It also distinguishes itself from the sibling memory_search by framing itself as the single-block variant.

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?

It explicitly names memory_search and states the condition that favors this tool: 'when you need a single context block.' There is no explicit when-not or prerequisite (e.g., whether it writes anything), but the comparative guidance is clear enough to route an agent.

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