Skip to main content
Glama

get_section_context

Read-only

Retrieve a section's full context: ancestor headings, target content, and child summaries, so you don't need to read the entire file.

Instructions

Retrieve a section with its full hierarchy context: ancestor headings (root → parent) for orientation, the target section's content, and immediate child summaries. Prevents 'section too thin' without falling back to whole-file reads.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesRepository identifier (owner/repo or just repo name)
max_tokensNoApproximate token budget for the target section's content (bytes/4 estimate). Ancestors and child summaries are always included.
section_idYesTarget section ID from get_toc, search_sections, etc.
include_relatedNov1.20+ adaptive context: append structural + semantic neighbor summaries.
include_childrenNoInclude immediate child section summaries (no content reads). Default true.
strip_boilerplateNov1.24+ — strip repeated cross-section fragments before returning the target section content.
Behavior4/5

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

Annotations already declare readOnlyHint=true. The description adds that ancestors and child summaries are always included, max_tokens is approximate, and describes optional features (include_related, strip_boilerplate). This goes beyond annotations by detailing what is guaranteed in the response.

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 two sentences with no wasted words. It front-loads the core purpose and hierarchy, then adds a clear benefit statement. Every sentence earns its place.

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 6 parameters and no output schema, the description covers the tool's input, behavior, and output structure (ancestors, target, children) comprehensively. It explains what each parameter does and what the response includes, leaving no major gaps.

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% with each parameter described. The description adds value by explaining max_tokens as approximate, clarifying that ancestors/children are always included, and providing version context for include_related and strip_boilerplate. This enriches the schema definitions.

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 it retrieves a section with its full hierarchy context, including ancestor headings, target content, and immediate child summaries. This distinguishes it from sibling tools like get_section (likely just the section) or get_section_summary (just summary). The phrase 'prevents section too thin' further clarifies its unique role.

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 that the tool is used to avoid 'section too thin' without whole-file reads, implying it provides richer context. However, it does not explicitly name alternatives like get_section or search_titles, though the purpose is clear enough for an agent to infer when to use this tool.

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/jgravelle/jdocmunch-mcp'

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