Skip to main content
Glama

Search code

search_code

Perform graph-augmented code search: deduplicate grep matches into functions, rank by structural importance. Choose signatures, source, or file paths.

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 (with source), 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)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Discloses the entire pipeline: grep, graph enrichment, deduplication, ranking, truncation, and response fields. With no annotations, the description fully communicates behavior, including the lack of offset and how to detect truncation.

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?

Single paragraph, front-loaded with purpose, then modes, then truncation details. Every sentence adds value with no redundancy.

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 complexity (8 params, graph enrichment, truncation), description covers what the tool does, how results are processed, and parameter usage. Output schema exists, so return values need not be detailed. No major gaps.

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 63%, so description adds meaning beyond schema by explaining the purpose of path_filter, file_pattern, and truncation behavior. Integrates parameters into usage flow, compensating for undocumented schema fields.

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 'Graph-augmented code search' with specific verb and resource, and differentiates from siblings like 'search_graph' by emphasizing grep then graph enrichment, modes, and deduplication.

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?

Provides guidance on when to use modes (e.g., compact for token efficiency), how to scope with path_filter, and how to handle truncation via limit or narrowing. Lacks explicit comparison to siblings for alternative selection, but the context is clear.

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