Skip to main content
Glama

get_document_toc

Read-onlyIdempotent

Lists headings with line numbers to create a table of contents, helping you navigate and locate specific sections in a document.

Instructions

    Returns the heading structure of a document as a
    table of contents with line numbers.

    Use this tool when you need to:
    - Understand the structure of a large document
    - Find specific sections before reading them
    - Navigate a document by its headings

    Line numbers in the output can be used with
    read_document(offset=...) or
    read_document_section(heading=...) to read specific
    parts.

    Args:
        document_id: The document ID

    Returns:
        Formatted table of contents with line numbers
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so description doesn't need to repeat. It adds that output is formatted TOC with line numbers, which is helpful. No contradictions.

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

Conciseness4/5

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

Description is in a structured block with clear bullet points. Not overly long, but could be more concise. Sentences earn their place.

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?

With output schema present, return values are covered. Description provides usage context and links to other tools. Complete for a simple read-only tool.

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?

Only one parameter (document_id) with 0% schema coverage. Description includes 'Args: document_id: The document ID', providing minimal but sufficient meaning for a straightforward parameter.

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?

Description clearly states it returns the heading structure as a table of contents with line numbers. It distinguishes from sibling tools like read_document and read_document_section by explaining usage for navigation and structure understanding.

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?

Explicitly lists when to use: understand structure, find sections, navigate by headings. Also suggests using line numbers with other tools. Lacks explicit when-not-to-use, but positive guidance is clear.

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/Vortiago/mcp-outline'

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