Skip to main content
Glama

build_context

Retrieves and compresses relevant memories from a knowledge graph to build a compact context pack for the current task, resolving contradictions and staying within a token budget.

Instructions

Recursively retrieves and compresses relevant Waggle memory for the current task, using graph, hybrid, transcript, update, and conflict-aware retrieval. Decomposes the query into targeted subqueries, expands the graph around key nodes, resolves contradictions and superseded memories, and returns a compact context pack under a configurable token budget. Aliases: recursive_context, assemble_context, rlm_context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoRetrieval depth mode: 'fast' runs fewer subqueries for low latency; 'balanced' is the default; 'deep' adds extra subqueries for thorough coverage.balanced
depthNoGraph expansion depth around retrieved nodes.
queryYesCurrent user task or question to build context for.
projectNoOptional project or workspace name used to partition memory.
agent_idNoOptional agent or client identifier used to partition memory.
session_idNoOptional conversation or run identifier used to partition memory.
token_budgetNoMaximum token budget for the context pack (approximate).
max_subqueriesNoMaximum number of decomposed subqueries to run.
include_evidenceNoWhether to include verbatim transcript evidence in the context pack.
Behavior4/5

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

With no annotations, the description bears full responsibility. It details internal logic: query decomposition, graph expansion, contradiction resolution. It implies read-only retrieval but does not explicitly state the tool does not modify state.

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 plus alias note. Front-loaded with main action. Could be trimmed slightly but is mostly efficient.

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

Completeness2/5

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

No output schema; the description only vaguely states 'returns a compact context pack' without specifying its structure or fields. For a tool with 9 parameters, the agent lacks sufficient information about what to expect.

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 has 100% coverage with detailed parameter descriptions. The tool description adds high-level context but does not enhance individual parameter semantics beyond what the schema already provides.

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?

Clear verb 'retrieves and compresses relevant Waggle memory' specifies the resource and action. Mentions aliases to disambiguate. The description distinguishes it from siblings by detailing its hybrid retrieval strategy.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives like query_graph or get_related. The description does not state when not to use it, leaving the agent to infer from context.

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/Abhigyan-Shekhar/Waggle-mcp'

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