Skip to main content
Glama
V.I.S.O.R.
by dibun75

build_context

Builds a ranked, token-limited context payload from a natural-language query, retrieving relevant code nodes for LLM prompts while preventing context overflow.

Instructions

    **Context Intelligence Engine** — the most powerful V.I.S.O.R. tool.

    Builds a ranked, token-budget-enforced context payload from a natural
    language query. Lexical retrieval is the default; semantic retrieval is
    an explicit opt-in. Ranking combines five signals:
    - Exact symbol name match
    - Co-location in the same file as the top hit
    - Retrieval similarity when semantic mode is enabled
    - Dependency graph distance
    - File recency

    Returns a scored list of code nodes ready to be injected into an LLM
    prompt, capped at 8,000 tokens to prevent context overflow.
    Example:
        ``build_context("how is authentication handled")``
    

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
queryYes
skillNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

B3.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does much of it: it discloses the 8,000-token cap, the ranking signal mix, the lexical-vs-semantic default, and the shape of the return (a scored list of code nodes). It stops short of stating side effects or safety (read-only), and the semantic-mode claim does not correspond to any exposed parameter.

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?

The operative sentence is front-loaded and the signal bullet list plus example are genuinely useful. The '**Context Intelligence Engine** — the most powerful V.I.S.O.R. tool' preamble is promotional padding that earns nothing.

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?

The output schema exists, so explaining return values is optional and the token-cap detail is a bonus. But for a high-leverage retrieval tool with an undocumented second parameter, an unreachable semantic mode, and many competing siblings, an agent still lacks what it needs to choose and configure this call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and only partly does. It clarifies `query` as a natural-language query via the example, but `skill` is never mentioned anywhere and its purpose, format, and effect on ranking are entirely unknown.

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?

States a specific verb and resource: builds a ranked, token-budget-enforced context payload from a natural-language query, and enumerates the five ranking signals. A reader knows exactly what comes back, but the description never names a sibling (search_codebase, get_symbol_context, get_file_context) to distinguish this retrieval path from the others.

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?

It says lexical retrieval is the default and semantic is opt-in, but there is no `semantic` parameter in the schema, so that guidance cannot be acted on. No when-to-use versus the many sibling retrieval tools is given, leaving selection to inference.

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