Skip to main content
Glama

markdown_generate_toc

Generate a table of contents from markdown headings. Returns TOC lines to use in documents without one.

Instructions

Generate a table of contents from markdown headings. Returns TOC lines without inserting them. Use this to create a new TOC for a document that doesn't have one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesThe markdown content to generate TOC from.
maxLevelNoMaximum heading level to include (1-6). Defaults to 6.
minLevelNoMinimum heading level to include (1-6). Defaults to auto-detect from document.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It importantly discloses that the tool 'Returns TOC lines without inserting them', indicating a non-mutating read-only behavior. This is a key behavioral trait beyond just generating lines. It doesn't mention edge cases or permissions, but for a simple generate-only tool, this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loaded with the core action ('Generate a table of contents from markdown headings'), and every sentence adds value: the first states the function, the second clarifies output behavior and the intended use case. No filler or redundant wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with this simplicity, the description covers all essential context: what it does, what it returns (TOC lines), and when to use it (for documents without a TOC). Since there is no output schema, the description's 'Returns TOC lines' adequately explains the return value. The sibling tools provide complementary context for selection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides full descriptions for all three parameters (markdown, maxLevel, minLevel) with 100% coverage. The description adds no additional parameter information, so the schema does the heavy lifting. This meets the baseline for complete schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Generate') and resource ('table of contents from markdown headings'). It also distinguishes itself from siblings by explicitly noting it 'Returns TOC lines without inserting them' and specifying the use case for 'a document that doesn't have one', which differentiates it from markdown_insert_toc and markdown_refresh_toc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear when-to-use instruction: 'Use this to create a new TOC for a document that doesn't have one.' This implies using other tools (like insert_toc or refresh_toc) when a TOC already exists, though it doesn't explicitly name alternatives. The context is clear enough for an agent to make a reasonable selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/dongood/tools-mcp-server'

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