Skip to main content
Glama

Write a project file

dreamagent_write_file
Destructive

WRITE ACTION — overwrite or create one source file in a DreamAgent project with the exact content given. For CHANGING an existing file, prefer dreamagent_edit_file (small targeted find→replace edits — no need to send the whole file). By default the write is immediately committed and pushed to the project's GitHub repo and recorded in its session history & version history (so the user can restore/revert). Changes go live after the project is rebuilt (dreamagent_build_publish).

MULTI-FILE EDITS: pass auto_commit=false on each write, then call dreamagent_commit_push once at the end — one commit and one history entry for the whole batch.

GUARDS (enforced server-side, the same as the in-app code editor): path stays inside the project, hidden/credential files (.env, .git, keys) are rejected, content is scanned for malware/shell signatures and blocked, 2MB size cap. Failed scans return the reason.

The user can undo damage by editing in the DreamAgent editor or restoring a previous version from version history — still, prefer precise minimal diffs.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>",
      "file_path": "<file_path>",
      "content": "<content>"
    },
    "name": "dreamagent_write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNo
contentYes
file_pathYes
project_idYes
auto_commitNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / auto_commit
      Added value: +{
      +  "default": true,
      +  "type": "boolean"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare this is a destructive write, and the description goes well beyond them: default auto-commit and push to GitHub, recording in session and version history, a rebuild requirement, server-side guards (path containment, .env/.git/key rejection, malware scanning, 2MB cap), and a recovery path via the editor or version history. The only shortfall is that it never says what a failed write returns beyond 'the reason,' though an output schema exists to cover that.

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?

Front-loaded with the action, then organized under clear MULTI-FILE EDITS and GUARDS headers, with everything sized to the task. Minor redundancy: the closing line repeats the earlier preference for dreamagent_edit_file's minimal diffs.

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?

For a destructive, multi-parameter write tool, it covers the commit model, batching pattern, guardrails, failure reasons, rebuild step, and undo path; with an output schema present, return values need not be described. Only `confirm` remains unaddressed.

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 0%, so the description must carry the load, and it does for most parameters: auto_commit's default behavior and its batch-edit use case, content's exactness and 2MB/scan constraints, and file_path's containment and hidden-file restrictions. The `confirm` boolean is never explained, leaving one of five parameters opaque.

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?

Opens with a specific verb+resource+scope: 'overwrite or create one source file in a DreamAgent project with the exact content given.' It explicitly separates itself from dreamagent_edit_file, so an agent can route without opening either schema.

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?

Gives explicit when-to-use guidance ('For CHANGING an existing file, prefer dreamagent_edit_file') and a concrete multi-file workflow: pass auto_commit=false on each write, then call dreamagent_commit_push once. It also names dreamagent_build_publish as the step required for changes to go live.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.