Skip to main content
Glama

lb_write_text

Destructive

Write or append UTF-8 text to files within allowed directories, replacing existing content in rewrite mode. Enables controlled file edits from AI chats without leaving approved paths.

Instructions

Write or append UTF-8 text inside configured allowed directories. Rewrite mode replaces existing content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
file_pathYes
write_modeNorewrite

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already indicate destructiveHint=true and readOnlyHint=false, so the description adds value by specifying that rewrite mode replaces existing content and that operations are confined to configured allowed directories. This goes beyond the annotations but does not cover other behaviors like file creation or error handling. With annotations covering the safety profile, a 3 is appropriate.

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 concise sentences, with the primary action front-loaded in the first sentence and the mode detail in the second. There is no waste, and every word contributes meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a write tool with no output schema, the description covers the core action and mode but omits details such as whether files are created if absent, path formats (absolute/relative), or success/error responses. Given the tool's simplicity and the annotations, it is adequate but not fully comprehensive.

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 description coverage is 0%, so the description must compensate. It explains the write_mode parameter via 'Rewrite mode replaces existing content' and implies text is the content and file_path is the target, but it does not provide syntax, format, or constraint details for file_path and text. The description adds some meaning but leaves gaps, warranting a 3.

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 explicitly states the tool writes or appends UTF-8 text to files within allowed directories, and clarifies rewrite mode replaces content. This clearly distinguishes it from sibling tools like lb_read_text (reading) and lb_patch_text_block (patching), so an agent can identify its purpose immediately.

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 provides clear context: it is for writing or appending text, not for reading or other operations. However, it does not explicitly name alternative tools or state when-not-to-use scenarios. The verb 'write' makes the usage obvious, but explicit guidance against using it for reads is absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.