Skip to main content
Glama

update_file_section

Replace the body of a single heading in a file without affecting siblings. The heading line remains unchanged. Use for precise edits instead of rewriting the entire file.

Instructions

Surgical write — replace the body of ONE heading without touching siblings. The heading line itself is preserved verbatim; only its body is rewritten. Persists via the same path as update_file (writes to disk → FTS reindex → git commit). Throws if the heading does not exist (this tool will NOT create a new section — append the section text via update_file first). Heading match is case-insensitive exact-string. No external auth or rate limits. Returns the updated file metadata. Use to make targeted edits without re-sending the whole body; for full-file replacement use update_file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesFile ID
headingYesHeading whose body to replace (case-insensitive)
contentYesNew body content (heading line is preserved automatically)
Behavior5/5

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

With no annotations, the description fully discloses behavior: heading line preserved verbatim, case-insensitive exact match, throws if heading missing, persistence path (disk→FTS→git commit), no auth or rate limits, returns metadata.

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?

Five sentences, front-loaded with key purpose, each sentence adding distinct value. No redundancy or fluff.

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 no output schema, the description mentions 'Returns the updated file metadata,' sufficient. Covers all contexts: purpose, error conditions, persistence, auth/rate limits, and usage alternatives.

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%, but the description adds meaning beyond parameter descriptions: explains heading match is case-insensitive exact-string, content is new body, and heading line is preserved automatically. Slight extra value.

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 is a 'surgical write' to replace the body of one heading, precisely distinguishing it from the sibling tool update_file which does full-file replacement. The verb 'replace' and resource 'heading body' are specific.

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?

Explicit guidance: use for targeted edits without re-sending whole body; for full-file replacement use update_file. Also states it will not create a new section, advising to use update_file first to append.

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/ctxnest'

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