Skip to main content
Glama
adam-hanna

semantic-search-mcp

by adam-hanna

search_code

Find functions and classes in a codebase by describing their purpose. Natural language queries return ranked code snippets with file locations and relevance scores.

Instructions

Search the codebase using semantic similarity.

Use natural language descriptions of code you're looking for:

  • "function that handles user authentication"

  • "error handling for HTTP requests"

  • "database connection initialization"

  • "unit tests for the payment service"

Returns ranked code snippets with file locations and relevance scores. Combines vector similarity with keyword search for best results.

Best for: Finding functions/classes by purpose or behavior. Not for: Exact pattern matching or finding all occurrences of a variable. Use Grep for exact patterns; use semantic search to find relevant files first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language search query
languageNoFilter by language: python, javascript, typescript, etc.
min_scoreNoMinimum relevance score threshold (0-1)
chunk_typeNoFilter by type: function, class, method, module
max_resultsNoMaximum results to return (1-50)
file_patternNoGlob pattern to filter files, e.g., '**/*_test.py'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
statusNoServer status: initializing, ready, or errorready
matchesYes
total_countYes
search_time_msYes
Behavior4/5

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

With no annotations, the description carries the burden. It discloses that the tool 'Combines vector similarity with keyword search' and 'Returns ranked code snippets with file locations and relevance scores.' It does not mention potential side effects or prerequisites like index freshness, but for a search tool this is reasonable behavioral context.

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?

Well-structured with a clear lead sentence, useful examples, return details, and 'Best/Not for' sections. Each sentence earns its place; no fluff despite being longer than average.

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 output schema already defines return structure, the description covers purpose, usage patterns, behavioral nuances, and comparison with alternatives. It is complete for an agent to decide when to invoke it and what to expect.

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 coverage is 100%, so baseline is 3. The description adds value by providing concrete query examples and explaining the combined vector+keyword behavior, which informs how to set min_score and query parameters beyond the schema's simple descriptions.

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 first sentence, 'Search the codebase using semantic similarity,' clearly states a specific verb (search), resource (codebase), and method (semantic similarity). Examples and 'Best for' section further clarify it finds functions/classes by purpose, distinguishing it from sibling tools which are indexing/lifecycle tools.

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 provides 'Best for' and 'Not for' sections, and names an alternative ('Use Grep for exact patterns') with a workflow suggestion ('use semantic search to find relevant files first'). This is clear when-to-use and when-not-to-use guidance.

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/adam-hanna/semantic-search-mcp'

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