Skip to main content
Glama

markdown_refresh_toc

Refresh an existing markdown table of contents to align with current headings, regenerating anchors and indentation. If no TOC is found, the content is returned unchanged.

Instructions

Refresh an existing table of contents (TOC) in markdown to match current headings. Detects TOC by pattern (- text), regenerates anchors, and updates indentation. Returns unchanged if no TOC exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesThe markdown content with a TOC to refresh.
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 burden of transparency. It discloses the detection pattern, anchor regeneration, indentation updates, and the no-TOC fallback. This provides a clear picture of behavior without contradictions, though it doesn't detail any side effects or errors (likely none for a pure transformation).

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, front-loaded with the primary purpose, and contains no filler. It effectively packs detection, behavior, and edge-case handling into a compact and scannable format.

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

Completeness4/5

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

For a 3-parameter tool with no output schema and no annotations, the description covers the core function, detection method, and the key edge case (no TOC). It doesn't elaborate on return format or option interactions, but these are not critical for the tool's usage. Overall, it provides enough context for an agent to select and invoke the tool correctly.

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?

Schema coverage is 100%, so parameters are already described in the input schema. The description does not add additional context about maxLevel/minLevel beyond what the schema states, but it does reference 'current headings' and 'indentation', loosely tying the parameters to the refresh behavior. This meets the baseline but provides no extra semantic value.

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 states a specific action ('Refresh an existing TOC') and resource ('markdown'), and distinguishes itself from siblings by focusing on existing TOC detection and refresh rather than generation or insertion. It also explains the detection pattern and regeneration behavior.

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 clearly implies when to use the tool: when you have markdown with an existing TOC that needs updating. It notes that it returns unchanged if no TOC exists, which is a useful exclusion. However, it doesn't explicitly name alternatives like markdown_generate_toc, so it stops short of full when-not/alternative guidance.

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