Skip to main content
Glama
Platano78

Smart-AI-Bridge

write_files_atomic

Write multiple files atomically with automatic backup and rollback. Ensures all changes succeed together or none are applied.

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
file_operationsYesArray of write operations to apply atomically. If any operation fails, all previously written files are restored from their backups.
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.
Behavior5/5

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

Without annotations, the description fully discloses destructive nature (writes to disk), rollback mechanism, backup file naming, and behavior on mid-batch failure (throws after restoring earlier files).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is long but each sentence adds value, front-loaded with purpose, and uses visual cues (emoji, bullet points). Could be slightly tighter but well-organized overall.

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?

Even without an output schema, the description explicitly defines the return format and covers edge cases like mid-batch failure rollback not in success response, making it highly complete for a complex tool.

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 already provides 100% description coverage, but the description adds meaningful context: atomicity, rollback behavior for file_operations, default value and use case for create_backup, and deprecation of legacy 'modify' value.

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?

Description clearly states it writes a batch of files atomically with backup, and explicitly distinguishes from sibling tools like modify_file for single-file edits and append operation for appending.

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?

Provides explicit when-to-use (config changes across modules, multi-file generation) and when-not-to-use (natural-language edits to single file → modify_file, appending → append operation), giving clear alternatives.

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