Skip to main content
Glama

update_file_section

Replace the body of a specific heading in a file, leaving the heading line and other sections untouched. Enables surgical edits without sending the full file content.

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?

Discloses persistence path (disk → FTS reindex → git commit), error condition (throws if heading doesn't exist), matching rule (case-insensitive exact-string), absence of external auth/rate limits, and return value (updated file metadata). No annotations provided, so description carries full burden and meets it.

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?

Single dense paragraph with front-loaded key concept ('Surgical write'). Every sentence provides value without redundancy. Efficient and well-structured.

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 3 required parameters, no enums, no output schema, the description covers behavior, persistence, matching, error conditions, and return. Agent has enough context to decide and use correctly.

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%, so baseline is 3. The description adds extra context: 'heading' is case-insensitive exact match, 'content' is new body excluding heading line. This improves understanding beyond schema defaults.

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 defines the tool as a 'surgical write' that replaces the body of one heading without touching siblings, preserving the heading line. It contrasts with update_file for full-file replacement, making the purpose unambiguous.

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?

Explicitly states when to use this tool ('targeted edits without re-sending whole body') and when not to (full-file replacement use update_file). Also warns that heading must exist and suggests appending via update_file first if needed.

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