Skip to main content
Glama

hybrid_search

Find relevant code by blending semantic vector search with knowledge graph proximity, returning ranked code chunks instead of entire files.

Instructions

Semantic vector search re-ranked by knowledge graph proximity.

Combines vector similarity (cosine) with structural graph proximity
(BFS distance from query-matched graph nodes). The final score is:

    score = alpha * vector_score + (1 - alpha) * graph_score

Both vector and graph scores are normalised to [0, 1] before blending.
Requires both index_codebase and index_graph to have been run.

Args:
    query: Natural language description of what you're looking for.
    path: Absolute path to the codebase root directory.
    top_k: Number of results to return (default 8, max 20).
    alpha: Weight of vector score vs graph score (0.0 = graph only,
           1.0 = vector only, default 0.6).
    min_score: Minimum blended score threshold (default 0.0).

Returns:
    Formatted list of code chunks ranked by blended score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
alphaNo
queryYes
top_kNo
min_scoreNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it provides substantial behavioral detail: the scoring formula, normalization of both scores, the alpha blending semantics, and the dependency on prior indexing. It does not mention side effects, error conditions, or read-only guarantees, but for a search tool the disclosed mechanics are strong.

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?

The description is well-structured: a one-line summary, a compact formula, a prerequisites line, an Args section, and a Returns section. Every sentence contributes, with no filler or redundant restatement of the tool name.

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

Completeness4/5

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

Given the tool's moderate complexity, five parameters, and an output schema, the description provides complete invocation guidance: prerequisites, parameter semantics, and return type. It could add explicit behavior when indexes are missing or stale, but nothing essential is missing for a competent agent.

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

Parameters5/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 fully compensate, and it does: every parameter gets meaningful semantics, ranges, defaults, and behavioral effect. This is rare and genuinely helpful for an agent selecting and filling arguments.

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 opens with a specific verb-resource phrase, 'Semantic vector search re-ranked by knowledge graph proximity,' which clearly identifies what the tool does. It further distinguishes itself by detailing the hybrid combination of vector similarity and graph proximity, though it does not explicitly name sibling tools like search_code or search_graph.

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 description clearly implies when to use the tool: when a hybrid of vector search and graph proximity is desired, and it states the precondition that both index_codebase and index_graph must have been run. However, it does not explicitly contrast this with pure alternative tools or say when not to use it.

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

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/VecGrep/vecgrep'

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