Skip to main content
Glama

Build Session Context

build_context
Read-onlyIdempotent

Assemble a token-budgeted memory context block that combines core rules, semantic facts, and episodic history to ground a session around a query.

Instructions

Assemble a token-budgeted <memory_context> block combining Core rules, Semantic facts, and Episodic history for session grounding.

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": "build_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoOptional retrieval context mode override.
queryYesTopic or task query to ground context around.
namespaceNoProject or workspace namespace.
token_budgetNoMaximum token budget for assembled context (default 4096).

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?

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world, so safety is covered. The description adds useful behavior context by revealing that output is token-budgeted and composed of three named layers. It does not disclose truncation/priority behavior when the budget is exceeded, or the ordering of the assembled block.

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?

A single front-loaded sentence with zero filler; the key artifact and its composition come first, and nothing is repeated from the schema or annotations.

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?

All four parameters are schema-documented and annotations cover the safety profile, so the essentials are present, and the description helpfully hints at output shape since there is no output schema. Gaps remain around how the six retrieval modes differ and what the assembled block looks like in practice.

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 query, mode, namespace and token_budget are already documented in the schema. The description only echoes the token-budget concept and the memory layers, adding no semantics about how mode alters retrieval or how namespace scopes results. Baseline 3 applies.

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?

The description gives a specific verb ("Assemble") and a specific artifact (a token-budgeted <memory_context> block) plus its three constituent layers (Core rules, Semantic facts, Episodic history). This is far more informative than the title alone. It stops short of distinguishing itself from plausible siblings such as recall_memories, so it lands at 4 rather than 5.

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 phrase "for session grounding" implies the situation in which to call it, but there is no explicit when-to-use vs when-not guidance and no named alternative (e.g. recall_memories for raw retrieval). Usage is inferable but left to the agent.

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