Skip to main content
Glama

locus_prepare_context

Prepares LLM agent context in a single call: retrieves, re-ranks, packs within token budget, assesses confidence, and adds knowledge-graph facts for query entities.

Instructions

All-in-one context preparation for LLM agents. Retrieves → re-ranks → packs into token budget → assesses confidence → adds KG facts for query entities. Single call returns everything needed to answer the query. Recommended primary tool for agent workflows.

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

Input Schema

NameRequiredDescriptionDefault
as_ofNoTemporal filter YYYY-MM-DD.
limitNo
queryYes
rerankNoApply heuristic re-ranking after RRF.
store_pathNo.locus
token_budgetNoMax tokens for packed_context.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.1

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose the internal stages and implies a safe read-only retrieval, plus a token budget that bounds output size, but it says nothing about latency/cost of the five-stage pipeline, what 'assesses confidence' actually returns, or failure behavior on an empty index.

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?

Front-loaded with the purpose and the pipeline in a compact arrow sequence, then the routing recommendation. Minor redundancy between 'All-in-one', 'Single call returns everything', and 'Recommended primary tool' — three restatements of the same idea.

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 6-parameter, no-annotation, no-output-schema tool, the description explains the what but not the shape of the answer: 'assesses confidence' and 'adds KG facts' hint at return content without defining it, and the default store_path is never mentioned. An agent can call it correctly but cannot anticipate the response.

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 50% and the description only adds meaning for token_budget (bound on packed_context) and rerank (applied after RRF) — both of which the schema already partly documents. It is silent on as_of, limit, and store_path (default '.locus'), leaving half the parameters unexplained in both places.

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?

Names a concrete resource (context preparation) and enumerates a specific pipeline: retrieve, re-rank, pack to token budget, assess confidence, add KG facts. Differentiates itself loosely from siblings by claiming to be the all-in-one 'primary tool', though it never names the narrower alternatives (e.g. locus_multi_retrieve, locus_cluster_retrieve) it replaces.

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?

'Recommended primary tool for agent workflows' gives a clear default-use signal for agents, and 'Single call returns everything needed' implies it should be preferred over composing several calls. No explicit when-not guidance, no named alternatives, and no cost/latency caveat for the multi-stage work.

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