generate_toc
Generate a formatted table of contents from Markdown with indented links to each heading. Handles duplicate slugs automatically and supports depth limits from 1-6.
Instructions
Generate a Table of Contents from Markdown headings. Returns a Markdown-formatted TOC with indented links to each heading. Handles duplicate heading slugs. The max_depth parameter controls the deepest heading level to include.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"markdown": "<markdown>"
},
"name": "generate_toc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markdown | Yes | The Markdown text to generate a TOC from. | |
| max_depth | No | Maximum heading depth to include (1-6, default: 6). |