Skip to main content
Glama

code_search

Search your codebase using natural-language descriptions to find exported functions, classes, and interfaces without knowing exact names.

Instructions

Semantic search over the codebase — finds exported symbols (functions, classes, interfaces) related to a natural-language query. Replaces blind grep when you don't know the exact symbol name.

Requires hivelore index code-search to have been run (builds embeddings for every exported symbol from the code-map). Falls back to a notice when index is missing.

PARAMETERS: query — natural language (e.g. 'function that hashes passwords', 'JWT signing') k — number of top hits (default 5) min_score — minimum cosine similarity (default 0.2; try 0.3+ for stricter)

RETURNS: { available: bool, hits: [{ file, name, kind, line, description?, score }] }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNoNumber of top hits to return.
queryYesNatural-language description of what you are looking for in the codebase (e.g. 'function that hashes passwords', 'JWT signing logic', 'route registration').
min_scoreNoMinimum cosine similarity. Hits below this threshold are dropped to avoid noise. Try 0.3+ for stricter matching.
Behavior5/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 dependency on a pre-built index, the fallback notice if the index is missing, the return format (including `available`, `hits` with fields like file, name, kind, line, description, score), and the effect of `min_score` in dropping low-similarity hits. It also scopes the search to exported symbols only, which is non-obvious behavior.

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 front-loaded: a crisp purpose statement, a usage rule with alternative, a prerequisite/fallback note, then compact PARAMETERS and RETURNS blocks. Every sentence contributes value, and there is no redundancy or filler.

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?

For a search tool with 3 parameters, no output schema, and no annotations, the description fully covers the essentials: what the tool does, when to use it, prerequisites, fallback behavior, parameter meanings, and return structure. It leaves no critical operational question unanswered.

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 description coverage is 100%, so baseline is 3. The description's PARAMETERS section largely paraphrases the schema: examples for query and the min_score tip ('try 0.3+ for stricter') are already present in the schema. No new meaning is added beyond the structured definitions, so it stays at the baseline.

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 performs 'Semantic search over the codebase' and 'finds exported symbols (functions, classes, interfaces) related to a natural-language query'. It distinguishes itself from blind grep, and in the context of siblings like code_map, it emphasizes natural-language search over exact matching, giving it a distinct purpose.

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?

It explicitly says 'Replaces blind grep when you don't know the exact symbol name', providing a clear when-to-use scenario and an alternative. It also discloses a prerequisite ('Requires `hivelore index code-search` to have been run') and the fallback behavior when the index is missing, giving the agent clear conditionals.

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/Doucs91/hivelore'

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