Skip to content
Docs menu

Tool reference · Save & recall

memory_context_build

Assembles a token-bounded context bundle for a task: related knowledge, recent episodes, applicable skills, rules, and known blind spots.

local stdio server read-only

When to use

  • You are starting a larger task and want one bundle of relevant background instead of several searches.
  • You need the context to fit a fixed token budget.

Parameters

NameTypeDefaultDescription
queryrequired string — What you need context for
project string — —
max_tokens integer 4000 —

Example

Arguments

{
  "query": "refactor billing job scheduling",
  "project": "my-api",
  "max_tokens": 3000
}

Result shape

{
  "knowledge": [
    {
      "id": 1842,
      "type": "decision",
      "content": "Use PostgreSQL advisory locks for the nightly billing job…",
      "project": "my-api",
      "activation_score": 0.72
    }
  ],
  "episodes": [],
  "skills": [],
  "rules": [],
  "competency": null,
  "blind_spots": [],
  "total_tokens": 312
}

Episodes and blind spots are only filled when project is given.

Values are illustrative; the keys follow the server's handler. MCP clients receive the result as JSON text content.

Server description

The description the server sends to your agent in tools/list, captured from the v14.7.0 source:

Build optimal context for a query. Combines: spreading activation + knowledge graph + episodes + skills + self-model. The 'brain thinking' tool.

Found a mistake? Open an issue on GitHub.

Search