Skip to main content
Glama

generate_toc

Read-onlyIdempotent

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesThe Markdown text to generate a TOC from.
max_depthNoMaximum heading depth to include (1-6, default: 6).

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/XJTLUmedia/MCP_Markdown_Formatter'

If you have feedback or need assistance with the MCP directory API, please join our Discord server