Skip to main content
Glama

code_search

Search an indexed local codebase with hybrid semantic and full-text queries to uncover existing patterns and examples for informed code review.

Instructions

Hybrid semantic + full-text search over an indexed local repository.

Embeds the query via Ollama, then runs a combined vector + FTS search with RRF reranking against the LanceDB index built by index_repo. Use this to find existing patterns, conventions, or examples in the codebase before reviewing a new implementation. Requires a running Ollama (the semantic layer is built in) and index_repo to have been run first.

Args: query: Natural language or code snippet describing what to find. root: Absolute path to the repository (must have been indexed first). k: Maximum number of results to return (default 8).

Returns: {query, root, results[{file_path, symbol, symbol_type, start_line, end_line, text, score?}]} or {"error": "..."} on failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
rootYes
queryYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the underlying mechanism (Ollama embedding, vector + FTS search with RRF reranking), critical dependencies, and the error return format. This is substantial, but it omits potential latencies or side effects (though as a search tool, side effects are minimal). Still, it covers the essential behavioral traits.

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 and efficient: a one-line summary, followed by a brief mechanism explanation, usage guidance, prerequisites, and then clearly labeled Args/Returns sections. Every sentence adds value without redundancy, making it appropriately sized for the tool's complexity.

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?

The description provides a complete picture for an agent: purpose, usage, prerequisites, detailed parameter semantics, return structure, and error handling. Without an output schema, it still specifies result fields. It covers all necessary operational context, making it ready for reliable invocation.

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?

The schema has 0% description coverage, but the description's 'Args' section thoroughly explains each parameter: query as natural language or code snippet, root as absolute path, and k as max results with default. This fully compensates for the missing schema descriptions and adds practical guidance.

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 opens with 'Hybrid semantic + full-text search over an indexed local repository,' which is a specific verb and resource. It clearly distinguishes itself from siblings by focusing on repository search, unlike tools for trace calls or MR diffs. The explicit use case ('find existing patterns, conventions, or examples') further reinforces its unique purpose.

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 clear context: 'Use this to find existing patterns, conventions, or examples in the codebase before reviewing a new implementation.' It also states prerequisites (Ollama running, index_repo executed). However, it does not explicitly mention when not to use it or name alternative tools, so it falls just short of a 5.

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/SurajKGoyal/myopic'

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