Skip to main content
Glama

search_code

Search a codebase using keyword, semantic, or hybrid queries to find relevant code chunks with file paths, line numbers, and relevance scores.

Instructions

Search the codebase using keyword, semantic, or hybrid search.

Args: query: Search query string (natural language or code). mode: Search mode - "semantic" for vector search, "keyword" for BM25, or "hybrid" for RRF fusion of both (default). top_k: Number of results to return (default: 10). path: Optional path prefix filter (e.g., "src/", "apps/ui/").

Returns: List of concise chunk results with file_path, language, start_line, end_line, definitions, preview, and relevance score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNohybrid
pathNo
queryYes
top_kNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, but the description discloses key behavioral traits: it returns 'concise chunk results' with specific fields (file_path, language, start_line, end_line, definitions, preview, and relevance score), and explains the default mode and return behavior. It does not explicitly state side effects (e.g., read-only), but 'search' inherently implies non-mutation, lending sufficient transparency.

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 with an Args/Returns format. Every sentence is informative: it states the purpose, enumerates parameters with defaults, and describes the return format. No redundant or filler content; it is appropriately sized for a tool with four parameters and multiple modes.

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?

Given the tool's moderate complexity, the description covers all essential aspects: purpose, parameters, defaults, and return value structure (already partially provided via output schema, but description reinforces it). The presence of an output schema and explicit Returns section makes it complete for an agent to invoke correctly. The relationship to index_status is implicit through naming.

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?

Schema description coverage is 0%, yet the description fully compensates by explaining every parameter: query, mode (with enum equivalent wording), top_k (default), and path (with example). It adds semantic meaning beyond the schema, clarifying mode options and path filter semantics, making parameter usage unambiguous.

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's purpose: 'Search the codebase using keyword, semantic, or hybrid search.' This is a specific verb+resource+modes formulation that immediately distinguishes it from the sibling tool index_status, which is about indexing status, not searching.

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 on how to use the tool, including three search modes with a default, and optional path filtering. It does not explicitly state when not to use this tool or directly name index_status as an alternative, but the sibling relationship is clear. The mode descriptions implicitly guide selection (e.g., hybrid as default).

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/jdtzmn/embecode'

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