Skip to main content
Glama

rename_file

Rename or move a file to a new location, creating parent directories as needed. Optionally overwrite existing files and update IDE symbol indexes immediately.

Instructions

Move (rename) a file. Parent directories of to are created if missing. Refuses to overwrite an existing destination unless overwrite=true. The LSP server is notified with FileDeleted (source) and FileCreated (destination) so symbol indexes and diagnostics update immediately. To duplicate a file without removing the source, use copy_file instead. For LSP-semantic identifier renames across files, use rename_symbol instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoAbsolute path, file:// URI, or workspace-relative path of the destination file. Parent directories are created automatically.
fromNoAbsolute path, file:// URI, or workspace-relative path of the source file.
dirty_okNoAllow moving a file that has uncommitted changes in its git repository. Default false — the move is refused if the source file is dirty. Pass true to proceed anyway.
overwriteNoAllow overwriting an existing destination file. Default false.
Behavior4/5

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

With no annotations, the description carries the full burden and it delivers: it discloses parent directory creation, overwrite refusal unless overwrite=true, and the LSP FileDeleted/FileCreated side effects that update symbol indexes and diagnostics. The dirty_ok behavior is left to the schema, which is acceptable because the schema describes it fully. It does not mention the return value, but that is a minor gap.

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?

Four sentences, each earning its place: purpose, parent-directory behavior, overwrite policy plus LSP side effects, and alternative tools. It is front-loaded and free of fluff — a model of concise, high-signal documentation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with LSP side effects, the description adequately covers the core behavioral expectations, notes the overwrite safety, and points to alternatives. The schema fills in parameter details (e.g., dirty_ok, from/to formats). It lacks an explicit statement about return value or error behavior, but no output schema exists and the description is still sufficient for safe use.

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?

The input schema covers all 4 parameters with detailed descriptions, so the baseline is 3. The description adds minimal extra meaning: it restates that parent directories are created and that overwrite is refused unless overwrite=true, both already in the schema. No unique parameter semantics beyond the schema are provided.

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 opens with 'Move (rename) a file' — a clear verb+resource pair that states exactly what the tool does. It explicitly distinguishes itself from copy_file (duplicates) and rename_symbol (LSP-semantic identifier renames), so the agent knows its unique scope.

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?

The description provides explicit when-not-to-use guidance: 'To duplicate a file without removing the source, use copy_file instead' and 'For LSP-semantic identifier renames across files, use rename_symbol instead.' This gives clear alternatives and helps the agent select the right tool.

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/plumbkit/plumb'

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