Skip to main content
Glama
umang-algo

Ketan-OS MCP Server

by umang-algo

ketan_write_file_safe

Write files with pre-flight validation, atomic snapshots, and automatic rollback on failure.

Instructions

Write a file to the workspace with FULL Ketan-OS protection:

  1. Pre-flight invariant guard: Python AST syntax check for .py files, dangerous pattern detection.

  2. Atomic snapshot of current workspace state before writing.

  3. Write the file.

  4. On any failure → automatic rollback to pre-write state.

Always prefer this over direct file writes for safe, reversible mutations.

Args: filepath: Path relative to workspace root (e.g., "src/main.py") content: Full file content to write

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
filepathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully carries the behavioral transparency burden. It discloses the pre-flight AST syntax check, dangerous pattern detection, atomic snapshot, and automatic rollback on failure, which is rich, non-obvious behavior and goes far beyond the schema.

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 well-structured with a short numbered list for the safety workflow and a separate Args section. It is front-loaded with the core purpose and every sentence serves a distinct purpose, with no redundancy.

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?

The description covers the tool's safety workflow, failure rollback, and required parameters sufficiently. An output schema exists, so returning values need not be detailed. Given the tool's moderate complexity, this is complete and actionable for an agent.

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

Parameters5/5

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

Schema coverage is 0%, but the description compensates well by explaining both parameters: filepath is 'Path relative to workspace root' with an example, and content is 'Full file content to write.' These definitions add meaningful semantics beyond the bare schema property names.

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 the tool writes a file to the workspace, with a specific safety/rollback protocol. It distinguishes itself from siblings by emphasizing 'safe, reversible mutations' and references direct file writes as the alternative, making its 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly advises 'Always prefer this over direct file writes for safe, reversible mutations,' providing clear usage context. However, it does not explicitly mention when not to use this tool or name alternative sibling tools (e.g., ketan_run_bash_safe) for other write scenarios, so it lacks full exclusion guidance.

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/umang-algo/ketan-os'

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