Summarize Markdown
Read markdown files in a specified directory and produce a structured summary of their contents.
Workflow
- Accept a directory path from the user.
- Use Glob to find all
*.mdfiles in the directory. - Use Read to read each file's contents.
- For each file, extract:
- The title (first
#heading) - Any YAML frontmatter description
- Key sections (second-level headings)
- The title (first
- Present a summary table to the user:
| File | Title | Key Sections |
|---|---|---|
| ... | ... | ... |
Rules
- Only read files — never modify, create, or delete anything.
- Limit to the specified directory — do not traverse parent directories.
- If no markdown files are found, report that clearly.