Skip to main content
Glama

Get assembled context

get_context

Assemble relevant memories into context before a task using hybrid retrieval with token budgeting and optional memory-graph expansion, so the AI can adapt to the user's preferences and history.

Instructions

Assemble relevant memories for the current task via hybrid retrieval (+ optional memory-graph expansion), with token budgeting. Use to load memory into context before a task.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of seed memories (default 10)
queryNoOptional focus query to seed hybrid retrieval
userIdNoScope context to a user (USER scope)
maxTokensNoToken budget for assembled context (default 2000)
projectIdNoScope context to a project
sessionIdNo
includeGraphNoExpand seeds with memory-graph neighbors
includeHistoryNoInclude superseded/archived memories

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.2
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv2.2.1

TDQS

B3.4/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 disclosure burden and does convey meaningful behavior: hybrid retrieval, optional graph-neighbor expansion, and a token budget that caps the assembled output. It does not state that it is a read-only operation, what the returned context looks like structurally, or what happens when the budget is exhausted or nothing matches.

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?

Two sentences, functional detail front-loaded, no filler words. The usage sentence is terse but earns its place by orienting the agent to the pre-task loading pattern.

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 an 8-parameter tool with no annotations and no output schema, the description covers the core concept and the budgeting behavior, but leaves gaps: no return-shape hint, no explanation of how the multiple scope parameters interact, and no coverage of the undocumented sessionId. Adequate but not complete.

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 coverage is 88%, so the schema already documents nearly all parameters, making 3 the baseline. The description adds framing value by explaining that the query seeds hybrid retrieval and that graph expansion and budgeting are tunable dimensions, but it adds no detail on scoping semantics (userId/projectId precedence) or on sessionId, which the schema leaves undocumented.

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?

Uses a specific verb ('Assemble') plus a clear resource ('relevant memories') and names the mechanism (hybrid retrieval, optional graph expansion, token budgeting), which distinguishes it from plain lookups like recall or search_history. It stops short of explicitly naming the sibling tools it differs from.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The second sentence gives a use case ('load memory into context before a task'), which implies when to call it. There is no guidance on when to prefer it over recall, search_history, or get_recent_interactions, and no exclusions or prerequisites.

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