search_sections
Search section bodies in a Markdown file for lines matching a regex query, returning line numbers and matching text. Excludes headings and child sections to avoid duplicates.
Instructions
Search all section bodies for lines matching query (regex).
Returns a list of match objects — one per section that contains at least one hit — in file order:
[
{
"path": "Root.Child",
"matches": [
{"line": 12, "text": "...the matching line text..."},
...
]
},
...
]line is the 1-based line number within the file.
Only each section's own body is searched (not its children), so results
are never duplicated across parent and child sections.
Note: heading text is not searched — only section bodies. If the term you
are looking for may appear in a heading, call get_index first and scan
the returned paths.
query is a Python regex; raises an error string if the pattern is invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| file_path | Yes | ||
| case_sensitive | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |