find_matching_chunks_in_file
Locate specific code segments in a file by searching for matching strings or patterns, ideal for identifying function references or definitions within your project.
Instructions
Step 2: Find the actual matching chunks in a specific file.
Required after find_files_by_chunk_content or list_all_files_in_project to see
matches, as those tools only show files, not their contents.
This can be used for things like:
- Finding all chunks in a file that make reference to a specific function
(e.g. find_matching_chunks_in_file(..., ["my_funk"])
- Finding a chunk where a specific function is defined
(e.g. find_matching_chunks_in_file(..., ["def my_funk"])
Some chunks are split into multiple parts, because they are too large. This
will look like 'chunkx_part1', 'chunkx_part2', ...
Input Schema
Name | Required | Description | Default |
---|---|---|---|
filter_ | Yes | Match if any of these strings appear. Match all if None/null. Single empty string or empty list will match all. | |
project_name | Yes | ||
rel_path | Yes | Relative to project root |
Input Schema (JSON Schema)
{
"properties": {
"filter_": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Match if any of these strings appear. Match all if None/null. Single empty string or empty list will match all.",
"title": "Filter"
},
"project_name": {
"title": "Project Name",
"type": "string"
},
"rel_path": {
"description": "Relative to project root",
"format": "path",
"title": "Rel Path",
"type": "string"
}
},
"required": [
"project_name",
"rel_path",
"filter_"
],
"title": "find_matching_chunks_in_fileArguments",
"type": "object"
}