Skip to main content
Glama

List LaTeX sections

list_sections
Read-only

Lists a .tex file's sectioning commands with nesting depth and line ranges, so you can target parts by title before reading or editing.

Instructions

List the sectioning commands in one .tex file, \part down to \subparagraph including starred forms, with their nesting depth and line ranges. Call it before read_section or edit_section to get the exact titles they match, and to address part of a paper by title instead of line numbers that shift with every edit. path names a single file: \input and \include are not followed, so list each included file separately, and commented-out headings are skipped. Pulls from Overleaf first. Returns one line per heading, indented by depth, as \section{Title} [lines start-end], or says the file has none; a missing, binary or out-of-project path fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the .tex file relative to the project root, e.g. main.tex.
projectNoWhich project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.8

TDQS

A4.9/5.0
Behavior5/5

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

With readOnlyHint=true and openWorldHint=true already covering safety, the description adds substantial behavior: it does not follow includes, skips commented-out headings, pulls from Overleaf first, and enumerates failure modes (missing, binary, out-of-project path). This goes well beyond the annotations.

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?

Front-loads the purpose, then usage, then file-scoping constraints, then return format. Every sentence carries distinct information with no filler.

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?

No output schema exists, and the description fully specifies the return shape (one indented line per heading as \section{Title} [lines start-end] or a 'none' message) plus failure behavior. Nothing an agent needs to call it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so both parameters are already documented, setting a baseline of 3. The description still adds meaning by clarifying that path addresses exactly one file and that includes are not traversed, which shapes how the agent uses the 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?

States a specific verb (List) and resource (sectioning commands in one .tex file) and pins the exact scope (\part down to \subparagraph, including starred forms). It is immediately distinguishable from siblings like read_file and project_summary.

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?

Explicitly says to call it before read_section or edit_section and explains why (to get the exact titles they match and to address by title rather than shifting line numbers). It also states the constraint that path names a single file and \input/\include are not followed, so the agent knows when to call it again per file.

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