Skip to main content
Glama

outline

Get the full heading hierarchy of a markdown file with line numbers. Locate sections quickly, then read only the relevant section.

Instructions

Full heading hierarchy of one markdown file with 1-based line numbers — its table of contents. Recognizes ATX (#…) and setext (===/---) headings; skips headings inside fenced code blocks and YAML frontmatter; handles CRLF. Returns {path, totalHeadings, truncated, headings:[{depth, text, line}], totalLines}; capped at 500. For source code use overview instead. Pick a section here, then read only it with heading(). lens is a navigation map over code and docs: use it to LOCATE things, then Read the actual source/section before judging or modifying it. A signature is not the body; an outline is not the section.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path. Relative paths resolve against the server's working directory; absolute paths are allowed only inside it (outside is rejected — call info to see the root). Code: .ts .tsx .mts .cts .js .jsx .mjs .cjs .py; docs: .md .markdown .mdx
Behavior5/5

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

With no annotations provided, the description carries full burden and delivers: it details the types of headings recognized (ATX, setext), what is skipped (fenced blocks, YAML frontmatter), CRLF handling, return fields, and the 500-heading cap. It also clarifies what the tool does not do ('A signature is not the body...').

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?

The description is information-dense but well-structured: purpose first, then details, then usage guidance. It is slightly verbose but every sentence adds value. Could be trimmed slightly, but overall efficient.

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?

Given the complexity of markdown heading extraction (ATX, setext, fenced code blocks, YAML frontmatter, CRLF, truncation), the description covers all relevant aspects. Despite no output schema, it lists return fields. It also provides crucial context for the tool's role in the wider set of tools.

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

Parameters5/5

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

The schema covers 100% of the parameter, but the description adds significant meaning: how relative and absolute paths resolve, allowed file extensions, and the rejection of paths outside the root. This goes well beyond the schema's minimal type/required info.

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 tool returns the full heading hierarchy of a markdown file with line numbers. It distinguishes itself from siblings like 'overview' (for source code) and 'heading' (to read a section), making the purpose specific and unambiguous.

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

Usage Guidelines5/5

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

The description explicitly tells when to use this tool vs alternatives: 'For source code use overview instead' and 'Pick a section here, then read only it with heading().' It also provides context for the broader 'lens' navigation approach.

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/segentic-lab/lens-mcp'

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