Skip to main content
Glama

search_with_mode

Read-onlyIdempotent

Select a search mode (lexical, semantic, hybrid, summary, or feeling_lucky) to route your query to the appropriate retriever for precise symbol lookup or conceptual search.

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)
Behavior5/5

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

Annotations indicate read-only, idempotent, non-destructive behavior; the description adds valuable context: return JSON structure, mode-specific prerequisites (AI provider for semantic), and fallback behavior. No contradictions with annotations.

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 concise and front-loaded, efficiently defining purpose and mode details. However, the 'P03 —' prefix is cryptic and the omission of 'graph_completion' mode slightly harms completeness.

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 no output schema, the description compensates by outlining the return format. It covers mode behavior, prerequisites, and relationship to sibling tool. Lacks error handling or edge cases but overall sufficient for a search tool.

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 100%, but the description only explains 5 of 6 enum values for 'mode' (missing 'graph_completion'). It adds meaning for the mode parameter but does not elaborate on 'limit' or 'query' beyond what schema provides. The gap reduces clarity.

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 states the tool is a named search-mode dispatcher, explains each mode's purpose, and explicitly distinguishes it from the existing `search` tool. It uses specific verbs and resources, making the purpose unambiguous.

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 mode-specific guidance (e.g., lexical for known symbol shapes, semantic for conceptual queries) and mentions degradation conditions. It distinguishes from the sibling `search` tool but does not explicitly state when to prefer one over the other, leaving some ambiguity.

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