Skip to main content
Glama

get_sections

Read-only

Extract heading structure from Typst or LaTeX files, returning types, titles, hierarchy levels, and previews to analyze document organization.

Instructions

Parse a source file and extract its heading structure. Typst (.typ) and LaTeX (.tex) are both supported; the parser is chosen from the file extension. For Typst this reports =-markup headings (the same ones the Typleaf editor's outline pane shows) as heading1..headingN; for LaTeX, \section/\subsection/etc. Returns types, titles, hierarchy levels, and content previews.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the source file. Typst (.typ) and LaTeX (.tex) are both supported; the parser is chosen from the file extension.
project_idYesTypleaf project ID — a 24-character lowercase hex string (e.g. '692a83fb82feceb233c4b0e7'), obtained from list_projects or the project URL. NOT a local filesystem path, NOT '.', NOT a project name or title. These tools operate on the REMOTE Typleaf project. Only call these tools when the user explicitly asks to work with a Typleaf project — never for general local file I/O. If you already have a copy of THIS project checked out on the local filesystem, prefer the standard read/grep tools against that path. Always call list_projects first when unsure.
Behavior4/5

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

The readOnlyHint annotation already signals read-only operation, so the bar is lower. The description adds value by specifying the exact payload returned (types, titles, hierarchy levels, content previews) and noting that parser selection is based on file extension. No contradictions or missing behavioral disclosures exist.

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 three sentences, front-loaded with the core purpose and then providing format-specific details and return contents. No redundant phrases or unnecessary clarifiers; every sentence contributes to understanding the tool's behavior.

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 two parameters, both required, and no output schema, the description adequately explains what the tool does, what it returns, and how it selects the parser. The project_id is fully documented in the schema, and the description covers the return structure enough for an agent to know what to expect. Nothing critical is missing for correct invocation.

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%: both file_path and project_id have detailed descriptions in the input schema. The tool description does not add substantial meaning beyond what the schema already provides—it repeats the file type support that is already in file_path. The project_id description in the schema is especially thorough, covering remote vs local context and how to obtain it. Thus the description adds marginal value over the schema, placing it at baseline 3.

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 parses a source file and extracts heading structure, naming both supported formats (Typst and LaTeX) and the output components (types, titles, hierarchy levels, content previews). It distinguishes itself from siblings like get_section_content (which likely fetches one section) and read_file (which reads raw content) by focusing specifically on the heading outline.

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 explains the context of use (parsing heading structure) but does not explicitly contrast with alternatives or state when not to use it. It gives clear context on file type selection and what it returns, which is sufficient for a tool that is primarily a straightforward parse-and-extract operation. The absence of explicit alternative routing is a minor gap, not a misleading one.

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/superzeldalink/typleaf-mcp'

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