treesitter_find_function
Locate function definitions by name in source files. Returns matches with optional source code, or writes output to a file to avoid context overload.
Instructions
Search for a specific function definition by name.
Args: file_path: Path to the source code file name: Name of the function to find include_source: If True, includes the source code for each matched function. output_file: If provided, writes result to this file instead of returning. Useful for large outputs to prevent context overload.
Returns: Dictionary containing: - query: The search query (function name) - matches: List of Symbol objects representing matching function definitions. If include_source is True, each match includes a "source" field. OR if output_file is set: {"status": "written", "output_file": "...", "bytes_written": N}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| file_path | Yes | ||
| output_file | No | ||
| include_source | No |