The server provides 13 well-structured tools with consistent naming patterns (all starting with 'treesitter_' prefix and using verb_noun convention). Tool descriptions are present and moderately detailed (avg 150-200 chars), exceeding the 20-char minimum. Input schemas are visible and include type definitions. However, several critical gaps reduce the score: (1) output schemas are not formally documented, the code shows what fields are returned, but LLMs cannot see structured schema definitions; (2) error handling is present but generic, lacking recovery guidance; (3) parameter descriptions vary in quality, with some being vague about constraints; (4) the 'output_file' pattern, while useful, is repeated across all tools and complicates the interface; (5) no pagination support despite tools that could return large result sets; (6) no discussion of limits or truncation behavior. The STDIO-only transport (below in Protocol Readiness) is the binding constraint that prevents this from scoring higher.
Output schemas not formally documented. While function docstrings describe return fields (file_path, language, symbols, errors), LLMs cannot parse structured schema definitions. According to pattern:tool requirement, 'Document the output schema. LLMs need to know what fields to expect so they can plan downstream tool calls and extract the right data.'
No pagination support for tools that return lists (symbols, nodes, call graphs, usages). According to pattern:paginated-result, 'Tools returning lists should accept page/offset and limit parameters and return a total count or next_cursor. Without pagination, large results blow the context window.' treesitter_get_ast, treesitter_analyze_file, and others could produce unbounded output.
Recommendations
Formalize output schemas: For each tool, add an explicit 'Returns' section with a JSON Schema or structured format. Example: 'Returns: {"symbols": [{"name": string, "type": string, "location": {"start_row": int, "start_column": int, "end_row": int, "end_column": int}}], "errors": [string], "language": string}'. This enables LLMs to plan multi-step queries confidently.
Add pagination to list-returning tools: For treesitter_analyze_file, treesitter_get_call_graph, treesitter_find_function, treesitter_find_variable, and treesitter_find_usage, add optional 'limit' (default 50, max 1000) and 'offset' (default 0) parameters. Return {'symbols': [...], 'total_count': int, 'limit': int, 'offset': int} so agents can iterate over large result sets.
Enhance error messages with recovery guidance: Replace generic error dicts with structured errors including category and suggestion. Example: {'error': 'File not found', 'category': 'user_fixable', 'path': '...', 'suggestion': 'Verify the file exists. Use get_supported_languages() to confirm the file type is supported.'}
Consolidate output_file handling: Remove the output_file parameter from all tools and instead implement a streaming or chunked response mechanism. Alternatively, document that large outputs will be truncated in the response and offer a batch write tool for users who need file export.
Clarify parameter constraints: For all row/column/range parameters, state: 'Row and column numbers are 0-based. Row must be >= 0 and <= total_lines. Column must be >= 0 and <= line_length. Out-of-bounds values return an error with the valid range.'
Error handling is generic and lacks recovery guidance. All tools return {'error': 'message'} but do not classify errors as retryable, user-fixable, or fatal. Per pattern:recovery-guide, 'Error responses must tell the LLM what to do next.' For example, when file is not found, the tool should suggest 'Verify the file path and try again' or 'Use list_files() to discover available files.'
Parameter 'output_file' is repeated in all 13 tools, creating coupling and interface bloat. Per pattern:tool, 'Each tool should do exactly one thing.' The output_file mechanism mixes I/O concerns into every tool. Better: make output handling a separate capability (e.g., via a write_result tool or response streaming) so the core tools remain focused on analysis.
Parameter descriptions lack detail on constraints and expected formats. For example, 'row' and 'column' are described as 'Row number (0-based)' and 'Column number (0-based)' but do not specify valid ranges, what happens if row exceeds file length, or whether columns must be within line bounds. Per pattern:tool-description, 'Describe the expected format, range, and allowed values directly in the parameter description.'
The 'include_source' parameter in treesitter_find_function and treesitter_find_variable is a boolean but its behavior is not fully specified. Does it include full source code or a snippet? Is there a size limit to prevent context explosion? Per pattern:tool-description, absence of such details forces LLMs to guess.
treesitter_run_query accepts a custom Tree-sitter S-expression query as a free-form string with no validation hints or error guidance. Per pattern:constrained-input, LLMs should be guided on valid query syntax. The description should include a link to Tree-sitter query documentation or example queries to reduce hallucination.
Tool descriptions do not specify what 'file_path' argument means in terms of relative vs. absolute paths, or whether ~/ expansion is supported. The normalize_path() function suggests expansion is supported, but the descriptions do not communicate this to LLMs. Per pattern:tool-description, 'Write descriptions as if prompt-engineering. State WHAT the tool does, WHEN to use it, and any prerequisites.'
Document max_depth semantics: For tools accepting max_depth (treesitter_get_ast, treesitter_get_node_at_point, treesitter_cursor_walk), clarify: 'max_depth controls how many levels of child nodes are included. -1 = unlimited, 0 = immediate node only, 1 = node plus direct children. Large depths may produce large outputs; consider pagination or output_file to avoid context overload.'
Add example queries for treesitter_run_query: Provide 3-4 example Tree-sitter queries in the description (e.g., '(function_definition name: (identifier) @func_name)') and link to https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries. This guides LLMs away from invalid syntax.
Clarify language auto-detection: Update file_path descriptions to state: 'Path can be absolute or relative. Tilde (~) is expanded. Language is auto-detected from file extension (.py, .c, .cpp, .h, .hpp, .js, .jsx, .ts, .tsx, .go, .java, .rb, .rs, .php).'
Document include_source behavior: For treesitter_find_function and treesitter_find_variable, add: 'When include_source=true, returns up to 500 chars of source code per match to prevent context overload. Use treesitter_get_source_for_range() to fetch the full source.'
Add tool composition notes: In treesitter_analyze_file description, suggest: 'For deeper analysis, use treesitter_get_ast() to extract the complete AST or treesitter_find_function() to search for specific symbols.' This guides multi-tool planning.