Skip to main content
Glama

search_code

Read-only

Search a codebase by meaning using natural language queries. Returns matching code chunks with file paths and snippets, refreshing the index automatically for current results.

Instructions

Semantic search over a codebase by MEANING using local embeddings.

Ask in natural language: "where do we retry failed uploads?", "code that parses the config file". Returns the best-matching chunks as path:start-end plus a snippet. Refreshes the index first unless refresh=false.

NOT for exact identifiers or strings — use Grep for those.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootYes
queryYes
top_kNo
refreshNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds valuable behavioral context: it refreshes the index first unless refresh=false, returns path:start-end plus a snippet, and uses local embeddings. This goes beyond the annotations and helps the agent predict side effects and output format.

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 compact and front-loaded: it opens with the core purpose, gives concrete examples, states the return format, and ends with a clear exclusion. Every sentence earns its place, and the structure makes it easy to scan.

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?

For a read-only search tool with no output schema, the description covers the main things an agent needs: what to ask, what results look like, the refresh side effect, and when to use a sibling instead. It doesn't detail top_k semantics or root scope, but those are minor given the schema defaults and the tool's simplicity.

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 description coverage is 0%, so the description must compensate. It explains the query parameter via natural-language examples and clarifies the refresh parameter's default behavior. It does not explicitly explain root or top_k, but root is fairly self-evident and top_k has a default; the description's examples and refresh clarification add meaningful value beyond the bare 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 states a specific verb ('search'), a resource ('codebase'), and a distinctive mechanism ('by MEANING using local embeddings'). It also gives concrete example queries and explicitly contrasts itself with Grep for exact identifiers/strings, which distinguishes it from sibling 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?

The description explicitly says when to use it ('Ask in natural language...') and when NOT to use it ('NOT for exact identifiers or strings — use Grep for those'). It also mentions the refresh behavior and how to disable it, giving clear operational guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.