Skip to main content
Glama
Platano78

Smart-AI-Bridge

by Platano78

write_files_atomic

Write multiple files atomically with automatic rollback on any failure. Ensures all-or-nothing file writes with backups for safe multi-file updates.

Instructions

Write a batch of files in a single atomic operation with automatic backup. All files succeed or all roll back on any failure. Use this when several file writes must land together (config changes across modules, multi-file generation output). For natural-language edits to a single file, use modify_file instead. For appending to a log or accumulator file, use the append operation here. Each overwrite produces a <path>.backup.<timestamp> file when create_backup is true (default). ⚠️ DESTRUCTIVE: every operation writes (or appends to) a real file on disk. The rollback path runs only when a LATER operation in the same batch fails — earlier successful writes are reverted from their backups, but if every operation succeeds, the new files stand and the backups remain on disk. Returns: {success, files_written, results:[{path, operation, success, size}], backups_created, backups:[{original, backup}]}. On a mid-batch failure the call throws after restoring earlier files (rollback is not reflected in a success response).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
create_backupNoWhen true, each file that would be overwritten is first copied to `<path>.backup.<timestamp>`. Set false only when you know the prior content is recoverable from version control.
file_operationsYesArray of write operations to apply atomically. If any operation fails, all previously written files are restored from their backups.
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It clearly warns 'DESTRUCTIVE', explains backup file creation, details the rollback mechanism (only on later failures, earlier writes restored), and states that backups remain on success. It also discloses throw behavior on mid-batch failure, offering comprehensive transparency.

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 dense but well-structured. It front-loads the core purpose, then provides usage, alternatives, destructive warning, rollback semantics, and return format. Every sentence adds value without redundancy, and the length is justified by the complexity of the atomic batch behavior.

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 the tool's complexity (atomic batch, rollback, backups, append operations) and the absence of an output schema, the description fully covers the return format, edge cases (mid-batch failure, success with remaining backups), and prerequisite safety info. It is complete enough for an agent to use the tool correctly without further clarification.

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%, providing a baseline of 3. The description adds extra meaning by explaining the behavior of `create_backup` (backups remain, timestamp format) and contextualizing `file_operations` with practical uses like append for logs. It enriches parameter understanding beyond the schema's own descriptions.

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's function: writing a batch of files atomically with automatic backup. It specifies the verb 'Write' and the resource 'batch of files', and distinguishes itself from sibling tools like `modify_file` by highlighting the batch and atomicity aspects.

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 usage guidance is provided: 'Use this when several file writes must land together' with concrete examples. It also names alternatives: 'For natural-language edits to a single file, use `modify_file` instead' and mentions the append operation for accumulator files, giving clear when-to and when-not-to 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/Platano78/Smart-AI-Bridge'

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