Skip to main content
Glama

read_section

Extract the content under a specific heading from a file. Returns the section body, line number, size, and estimated tokens. Requires exact heading name.

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?

Despite no annotations, the description discloses read-only nature, no side effects, auth, or rate limits. It also details exact-string matching behavior and that missing heading returns isError.

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?

Four sentences, each serving a distinct purpose: output format, matching details, error/read-only declaration, and usage pairing advice. No redundant or unnecessary content.

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?

For a tool with 2 parameters and no output schema, the description fully specifies return fields (body, level, line, size_bytes, est_tokens) and error behavior (isError). It also covers edge cases like case-insensitive trim and missing heading.

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 has 100% coverage with descriptions for both file_id and heading. The description adds value by clarifying heading matching is case-insensitive and exact-string after trim, rejecting fuzzy/partial matches.

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 verb 'Return' and the resource 'body of ONE heading', specifies what is excluded (heading line) and included (level, line, size_bytes, est_tokens). It also distinguishes from siblings by naming `read_file_outline` and `read_file_lines`.

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?

Provides explicit guidance on when to use this tool versus alternatives: 'Pair with `read_file_outline` when you are unsure which headings exist; for non-heading line ranges use `read_file_lines`.' Also explains matching behavior and error case.

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