Skip to main content
Glama

Search code

search_code
DestructiveIdempotent

Search code files with regex or text, and receive deduplicated function matches ranked by importance, with signature-only or full-source modes.

Instructions

Graph-augmented code search. Finds text patterns via grep, then enriches results with the knowledge graph: deduplicates matches into containing functions, ranks by structural importance (definitions first, popular functions next, tests last). Modes: compact (default, signatures only — token efficient), full (source capped at a 60-line window around the first match per hit; source_truncated marks the cut — use get_code_snippet for the complete symbol), files (just file paths). Use path_filter regex to scope results. TRUNCATION: enriched results are capped at limit (default 10). Response carries 'total_grep_matches' (raw grep hit count) and 'total_results' (deduplicated function count) — compare to limit to detect truncation. There is no offset parameter; to see more, raise limit or narrow the query with file_pattern / path_filter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNocompact: signatures+metadata (default). full: with source. files: just file list.compact
limitNoMax enriched results per call. Default 10. Response includes 'total_grep_matches' and 'total_results' so callers can detect truncation. No offset parameter — raise limit or narrow with file_pattern / path_filter to see more.
regexNo
contextNoLines of context around each match (like grep -C). Only used in compact mode.
patternYes
projectYes
path_filterNoRegex filter on result file paths (e.g. ^src/ or \.(go|ts)$)
file_patternNoGlob for grep --include (e.g. *.go)
Behavior1/5

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

The description implies a purely read-only search operation with no destructive or mutating effects. However, the annotations set `destructiveHint: true` and `readOnlyHint: false`, directly contradicting the described behavior. This is a serious inconsistency that misleads the agent about potential side effects, warranting a score of 1 per the annotation contradiction rule.

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 densely packed with essential information without redundancy. It is logically structured from the core mechanism, to modes, to truncation/pagination, with every sentence contributing predictive value. Despite its length, it remains concise and front-loaded with the most critical traits.

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 there is no output schema, the description thoroughly explains return-related details including `total_grep_matches`, `total_results`, and `source_truncated`, along with mode-specific output differences. It also covers edge cases like truncation, the lack of an offset, and the alternative `get_code_snippet` for complete source. For a complex tool, this is remarkably complete.

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?

The description significantly enriches schema parameters by explaining mode semantics (compact/full/files and their use cases), limit & truncation behavior, and the `source_truncated` flag. It also clarifies that `context` only applies in compact mode and elaborates on `path_filter` and `file_pattern` beyond their schema descriptions. With 63% schema coverage, the description compensates well for any gaps, though `pattern` and `project` remain minimally described.

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 as 'Graph-augmented code search' with a specific verb+resource combination. It distinguishes itself from siblings by detailing grep-based text pattern matching plus knowledge graph enrichment, and explicitly contrasts with get_code_snippet for retrieving complete source, making its unique purpose unambiguous.

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 guidance on when to use each mode (compact for token efficiency, full for source windows, files for just paths) and recommends `get_code_snippet` when complete symbols are needed. It also advises using `path_filter` to scope results and explains how to handle truncation. While it doesn't explicitly contrast with sibling search tools like search_graph, the context and alternatives are well stated.

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/DeusData/codebase-memory-mcp'

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