Skip to main content
Glama

update_file_section

Surgically update one section in a markdown file by replacing its body while preserving the heading and siblings. Writes to disk, reindexes search, commits to git; errors if heading not found.

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
contentYesNew body content (heading line is preserved automatically)
file_idYesFile ID
headingYesHeading whose body to replace (case-insensitive)
Behavior5/5

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

With no annotations, the description carries full burden and delivers: persistence path (writes to disk → FTS reindex → git commit), error behavior (throws if heading doesn't exist), matching semantics (case-insensitive exact-string), and return value (updated file metadata). It also states 'No external auth or rate limits', which is a useful baseline disclosure.

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 front-loaded with a one-line summary and each subsequent sentence adds distinct value: preservation behavior, persistence, error condition, scoping, and alternatives. No redundant clauses; it's appropriately sized for the complexity.

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?

Despite no output schema, the description covers return value, side effects, error handling, edge cases (case-insensitivity), and sibling relationships. It is complete for a mutation tool with zero annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions for all three parameters. The description adds marginal context like 'exact-string' for heading and reinforces that content is the new body, but the schema already captures these meanings. Baseline 3 is appropriate since the schema does the heavy lifting.

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 opens with a specific verb+resource: 'Surgical write — replace the body of ONE heading without touching siblings.' It clearly distinguishes from `update_file` by scoping to one heading and explicitly mentions the alternative for full-file replacement.

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 provides explicit when-to-use guidance: 'Use to make targeted edits without re-sending the whole body; for full-file replacement use `update_file`.' It also warns against using it to create new sections, directing to `update_file` instead, which serves as a clear exclusion.

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