Skip to main content
Glama

Get Chat Context

memory_chat_context

Selects and returns relevant stored memories to inject as context for the current prompt within a character budget, so assistants can start each turn with useful history.

Instructions

Returns the optimal set of memories to inject as context for the current prompt, respecting a character budget. This is typically the first tool an assistant calls at the start of a turn.

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": {
      "prompt": "<prompt>"
    },
    "name": "memory_chat_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYesThe current user prompt or conversation snippet
user_idNo
max_charsNo
namespaceNo
max_memoriesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It discloses the budget constraint and that the result set is 'optimal' (i.e., selected/ranked rather than a raw dump), but says nothing about side effects, what happens when no memories match, or how ranking works.

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 tight sentences, front-loaded with the core behavior and followed by the invocation cue. Nothing redundant or padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter tool with no annotations and no output schema, the definition covers purpose and timing but not the four undocumented parameters or the shape of what comes back (e.g., whether memories carry ids needed for later update/pin calls).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 20%: just 'prompt' is documented. The description alludes to max_chars via 'character budget' but leaves user_id, namespace, and max_memories entirely unexplained in both schema and prose, so an agent must guess scoping and cap semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: returns memories to inject as context for the current prompt, constrained by a character budget. That is clearly distinct from memory_search's query semantics, though the description never names or contrasts a sibling explicitly.

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?

Gives a concrete timing cue: 'typically the first tool an assistant calls at the start of a turn.' That is real when-to-use guidance. It stops short of saying when not to use it, or when memory_search or memory_related would be the better choice.

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