Skip to main content
Glama

search_with_mode

Read-onlyIdempotent

Route code search queries to different retrieval modes: lexical, semantic, hybrid, summary, or auto-route with feeling_lucky.

Instructions

P03 — named search-mode dispatcher.

Pick a mode to route the query to a specific retriever:

  • lexical BM25/FTS5 over symbol names — best when you know the symbol shape.

  • semantic Vector-NN over embedded summaries — best for conceptual queries (requires AI provider + embed_repo).

  • hybrid Reciprocal-rank fusion of lexical + semantic. Degrades to lexical when no AI provider.

  • summary Lexical hits augmented with each symbol's stored summary text — cheap context.

  • feeling_lucky Auto-router: symbol-shape (camelCase/PascalCase/snake_case/FQN) → lexical, everything else → hybrid.

The existing search tool is unchanged; this is an additive surface. Returns JSON: { mode, items: [{ symbol_id, name, file, line, score, snippet? }], total }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
modeNoNamed retriever — defaults to feeling_lucky
limitNoMax results (default 20)
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false. The description adds context beyond annotations: it mentions that semantic mode requires an AI provider and embed_repo, and that hybrid degrades to lexical. This provides useful behavioral insight. However, the 'graph_completion' mode is not explained.

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 description is relatively concise and front-loaded with the tool's identity. It uses a bullet-like list to explain modes efficiently. While it is not overly verbose, it could be slightly more streamlined without losing clarity.

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 absence of an output schema, the description provides the return format explicitly. It covers the tool's purpose, available modes, requirements, fallback, and output structure. However, the 'graph_completion' mode listed in the enum is not described, which is a minor gap.

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

Parameters4/5

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

The input schema has 100% coverage, providing a baseline of 3. The description adds significant meaning to the 'mode' parameter by explaining each enum value with its behavior and requirements. It also mentions defaults (feeling_lucky). The 'query' and 'limit' parameters are not elaborated, but the schema is sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as a 'named search-mode dispatcher' that routes queries to specific retrievers. It lists different modes and their behaviors, and explicitly distinguishes itself from the existing 'search' tool, making its purpose and differentiation clear.

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?

The description provides guidelines for when to use each mode: lexical for known symbol shapes, semantic for conceptual queries (requires AI provider + embed_repo), and explains that hybrid degrades to lexical. It mentions the existing search is unchanged, indicating this is additive, but does not explicitly state when not to use this tool versus alternatives.

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

Install Server

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/nikolai-vysotskyi/trace-mcp'

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