Skip to main content
Glama

ts_rename_file

Update all imports referencing a file after moving or renaming it on disk. Move the file first, then call this to apply changes to disk.

Instructions

Update all imports that reference a file after it has been moved or renamed on disk. Move the file first, then call this. Applies the changes to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newPathYesNew relative file path
oldPathYesPrevious relative file path

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4/5.0
Behavior3/5

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

The description discloses that the tool 'Applies the changes to disk', which is a behavioral trait indicating it performs a write operation. However, no annotations are provided, so the description carries the full burden of behavioral disclosure. It doesn't mention whether the operation is reversible, whether it requires a prior rename_prepare call, or what happens if the oldPath no longer exists. The statement 'Applies the changes to disk' is useful but minimal; it doesn't disclose potential side effects like modifying many files or requiring a save.

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 three sentences, each earning its place. The first sentence states the core purpose, the second gives the required precondition, and the third discloses the disk-write behavior. It is front-loaded with the primary action and contains no filler or redundant information.

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 tool with only two parameters and no output schema, the description covers the essential context: what it does, when to call it, and that it writes to disk. It doesn't explain the return value, but since there is no output schema, that's less critical. It also doesn't mention whether the tool requires a prior rename_prepare call, which could be relevant given the sibling tool rename_prepare exists. However, the description is largely complete for an agent to invoke it correctly.

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 both parameters (oldPath and newPath) are already described in the schema as 'Previous relative file path' and 'New relative file path'. The description adds context by explaining that oldPath is the file's path before the move and newPath is after, but it doesn't add significant detail beyond the schema. The baseline of 3 is appropriate since the schema already documents the parameters adequately.

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 purpose: updating all imports that reference a file after it has been moved or renamed on disk. It specifies the verb 'update', the resource 'imports that reference a file', and the context 'after it has been moved or renamed on disk'. This distinguishes it from sibling tools like rename_prepare and rename, which handle the rename operation itself, and from ts_organize_imports, which organizes imports rather than updating paths.

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?

The description provides clear usage context: 'Move the file first, then call this.' This tells the agent the required sequence of operations. It doesn't explicitly state when not to use this tool or name alternatives, but the sibling list includes rename_prepare and rename, and the description's focus on post-move import updates makes the usage context clear. The instruction 'Move the file first' is a strong usage guideline, though it doesn't explicitly exclude cases where the file hasn't been moved.

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