Skip to main content
Glama
vrppaul
by vrppaul

search_code

Find code snippets by meaning, not just text matching. Use natural language queries to locate relevant code functions, error handling, or setup logic without knowing exact variable names.

Instructions

Search for code semantically similar to the query.

Finds code by meaning, not just text matching. Use this when you want to find code related to a concept without knowing exact variable/function names.

Examples:

  • "authentication logic" - finds login, session handling, token validation

  • "error handling for API calls" - finds try/except blocks, error responses

  • "database connection setup" - finds connection pooling, ORM initialization

Automatically indexes the project if not already indexed, and re-indexes any files that have changed since the last search.

Args: query: Natural language description of what you're looking for. project_path: Absolute path to the project root directory. limit: Maximum number of results to return (default 10).

Returns: List of matching code chunks with file path, line numbers, content, and score.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
project_pathYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description discloses automatic indexing and re-indexing of changed files, which is a key behavioral trait. No annotations are provided, so the description handles the transparency burden well.

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 well-structured with clear sections: purpose, usage, behavioral note, args, and return. While slightly verbose in examples, every sentence adds value and it is easily scannable.

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 the complexity of semantic search with auto-indexing, the description covers purpose, usage context, parameter details, behavior, and return format. It lacks a warning about potential indexing delays but is otherwise complete.

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 input schema has 0% description coverage, but the description explains each parameter in natural language: query as 'Natural language description,' project_path as 'Absolute path,' limit with default and maximum. This adds significant meaning beyond the schema.

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 code search, distinguishes from text matching, and provides concrete examples. It differentiates from sibling tools (index_codebase, index_status) which are about indexing.

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 advises when to use: 'when you want to find code related to a concept without knowing exact variable/function names.' It implicitly contrasts with text search but does not explicitly mention alternatives like grep. However, the guidance is sufficient.

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/vrppaul/semantic-code-mcp'

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