Skip to main content
Glama

read_section

Extract the body under a specific heading from a file, returning content with level, line, size, and estimated tokens. Requires exact heading match; returns an error if the heading is missing.

Instructions

Return the body of ONE heading (the heading line itself is excluded) plus level, line, size_bytes, and est_tokens. Heading match is case-insensitive but exact-string after trim — fuzzy / partial matches do NOT resolve. Returns isError if the heading is absent. Read-only; no side effects, auth, or rate limits. Pair with read_file_outline when you are unsure which headings exist; for non-heading line ranges use read_file_lines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesFile ID
headingYesHeading text to extract (case-insensitive)
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states matching rules ('case-insensitive but exact-string after trim', 'fuzzy / partial matches do NOT resolve'), error behavior ('Returns isError if the heading is absent'), and safety ('Read-only; no side effects, auth, or rate limits').

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 compact (~80 words) and well-structured: it front-loads the core action and output, then clarifies matching semantics and error behavior, and ends with usage guidance. Every sentence adds value without redundancy.

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?

The description covers purpose, output fields, error condition, matching edge cases, and provides alternative tool references. Given the lack of output schema and annotations, this description is remarkably complete, giving the agent all necessary information to decide when to call this tool and what to expect.

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?

Both parameters are already documented in the schema, but the description adds critical semantics for the `heading` parameter: exact string match after trimming, case-insensitivity, and that fuzzy/partial matches fail. It also clarifies the return body and error condition, which are not in the schema.

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 explicitly states the action: 'Return the body of ONE heading' and lists the additional output fields. It clearly distinguishes this from sibling tools like `read_file_outline` and `read_file_lines`, which are mentioned as alternatives for different use cases.

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 instructs when to use alternatives: 'Pair with `read_file_outline` when you are unsure which headings exist; for non-heading line ranges use `read_file_lines`.' This provides clear when-to-use and when-not-to-use guidance, naming specific sibling tools.

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/safiyu/kontexta'

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