MCP server for searching codebases using ast-grep patterns for structural code matching
Single tool 'ast-grep' with explicit registration via mcp.NewTool(). Tool has a description (138 chars, within 10-1024 range), proper type annotations, and three parameters with descriptions. However, descriptions are relatively terse and lack WHEN-to-use context and dependency hints expected in production tools. Output format is documented as JSON but no structured schema is provided for the output object. Error handling is basic (returns CommandError string) without recovery guidance. The tool's name 'ast-grep' starts with the command name rather than an action verb (search_codebase, find_patterns), which reduces discoverability. Parameters are well-typed (string) but lack constraints like patterns/enums and expected format details. No pagination support despite potentially returning large result sets.
Search codebases using ast-grep patterns for straightforward structural matches. (returns json)
Tool name 'ast-grep' does not start with action verb; should use verb_noun pattern like 'search_patterns' or 'find_code_matches'
Tool description (138 chars) lacks WHEN-to-use guidance and prerequisites. Missing context about pattern syntax requirements, language support, and typical use cases
Output schema is documented informally as '(returns json)' but no structured schema provided. LLM cannot infer what fields to expect or plan downstream tool composition
'pattern' parameter description lacks format constraints (valid AST structure noted but not formalized). No examples of valid patterns for common languages
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 51 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 43 | - | v1 |
Error handling returns raw CommandError string. Does not categorize errors (retryable vs user-fixable vs fatal) or guide LLM recovery. Missing actionable error messages
No pagination support documented. Tool may return arbitrarily large result sets, risking context window exhaustion with no limit specified
'lang' parameter defaults to auto-detection but is not required. Description does not list supported languages or format constraints
'dir' parameter defaults to '.' but description says 'current working directory', unclear whether relative paths are resolved from cwd or from /src (based on Dockerfile WORKDIR)