Skip to main content
Glama

copy_file

Copy a file to a new path while preserving permissions, creating missing parent directories, and refusing overwrite unless explicitly allowed.

Instructions

Copy a file to a new path, preserving file permissions. Parent directories of to are created if missing. Refuses to overwrite an existing destination unless overwrite=true. Cross-device copies are supported. Notifies the LSP server with FileCreated so diagnostics update immediately. The response shows the diff of what landed at the destination — every line added, plus the destination it replaced when overwrite=true — gated by [edits].show_write_diff. To move or rename a file, use rename_file instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoAbsolute path, file:// URI, or workspace-relative path of the destination. Parent directories are created automatically.
fromNoAbsolute path, file:// URI, or workspace-relative path of the source file.
dirty_okNoAllow copying a file that has uncommitted changes. Default false.
overwriteNoAllow overwriting an existing destination file. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.16.6

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses permission preservation, automatic parent-directory creation, refusal semantics for existing destinations, cross-device support, an LSP FileCreated side effect that mutates diagnostics state, and the diff response gated by [edits].show_write_diff. These are exactly the side effects and failure modes an agent needs.

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 and refusal rule, then side effects and the sibling routing. Every sentence carries information, though the diff/response sentence is dense and could be trimmed slightly.

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 mutation tool with no annotations and no output schema, the description covers input preconditions, side effects, and what the response contains (the diff, including the replaced destination when overwriting). Nothing an agent needs to call it correctly is missing.

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 100%, so baseline is 3. The description reinforces overwrite behavior but adds no syntax or format detail beyond the schema, and never mentions dirty_ok.

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 ('Copy a file to a new path') and immediately differentiates itself from siblings by naming rename_file as the tool for moving/renaming. An agent can distinguish this from write_file and rename_file without opening any schema.

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?

Explicitly states the overwrite precondition (refuses unless overwrite=true) and routes move/rename intent to rename_file. It lacks guidance on when to prefer this over write_file or edit_file, but the primary exclusion is clearly stated.

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