Skip to main content
Glama

smart_search

Describe code functionality in natural language to search symbols. Converts queries like 'handle BLE pairing failure' into FTS5 keywords and runs semantic embedding to find relevant results.

Instructions

Natural-language search: Ollama generates FTS5 keywords, then searches the index.

Multi-phase approach:

  1. Translate non-English queries

  2. Rough FTS5 search to gather sample symbols

  3. Ollama sees those samples + query and generates FTS5 terms

  4. Refine: Ollama checks results and course-corrects

  5. FTS5 search with generated terms

  6. Semantic embedding search (cosine similarity)

  7. Score, deduplicate, format

When to prefer over search_code: When you don't know the exact keywords and want to describe what you're looking for ("how does the modem connect?", "handle BLE pairing failure").

Fallback: When Ollama is unavailable, falls back to direct FTS5 search with word-split terms from the query.

Args: query: Natural language description of what you're looking for. Be specific — 5–15 words works best. project_root: Absolute path to the project. Defaults to nearest git root. limit: Maximum number of results (default 20, max 100).

Returns: list of dicts with metadata entries (_generated_queries, _rough_queries, _translated_from) followed by symbol results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language description, 5-15 words. E.g. 'how does the modem connect?' or 'handle BLE pairing failure'.
project_rootNoProject root. Auto-detected if omitted.
limitNoMaximum results (default 20, max 100).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations provided, but description details the entire multi-phase pipeline, use of Ollama, fallback to direct FTS5, and even the return structure with metadata. Very transparent.

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?

Well-structured with numbered phases and bullet points, but the description is somewhat lengthy. Could be slightly more concise while retaining clarity.

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

Completeness5/5

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

Covers all aspects: purpose, when to use, how it works, fallback, parameters, and return format. Output schema exists, so full return details not needed, but description still mentions metadata keys.

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?

Schema covers 100% of parameters, but description adds extra value: query length advice, auto-detection of project_root, and limit cap. Minor improvement over schema alone.

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?

Clearly states natural-language search with multi-phase approach, and explicitly contrasts with sibling tool search_code. The verb 'search' and resource 'index' are specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to prefer this tool over search_code ('when you don't know exact keywords'), describes fallback behavior, and advises on query length (5-15 words).

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/turbyho/fw-context-mcp'

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