Skip to main content
Glama
krystofbe

rope-mcp-server

by krystofbe

move_and_rename_module

Moves a Python module to a folder, optionally renames it, and fixes imports from both the source and destination packages.

Instructions

Move a module to a folder and optionally rename it.

This is a two-step operation:

  1. Move module to destination folder

  2. Rename the module (if new_name provided or auto-detected)

Auto-detection: If module is foo_bar.py and dest is foo/, it will automatically strip the foo_ prefix → foo/bar.py

Includes workaround for Rope bug: Files that import from BOTH the destination package AND the module being moved are temporarily hidden during the move, then their imports are fixed manually.

Example: move_and_rename_module( "views/service_contractor_extra.py", "views/service_contractor/", new_name="extra" # or None for auto-detect ) Result: views/service_contractor/extra.py

Args: project_path: Root directory of the Python project module_path: Path to module file (relative to project_path) dest_folder: Destination folder path (relative to project_path) new_name: New name for the module (without .py), or None to auto-detect

Returns: JSON with success status and list of changed files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
module_pathYes
dest_folderYes
new_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description transparently explains the two-step operation, auto-detection logic, and a Rope bug workaround. It also mentions the return format. While it discloses these behaviors, it does not explicitly state destructive nature or permissions.

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 well-structured with a clear summary first, followed by detailed steps, example, and parameter list. Every sentence adds value without redundancy.

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?

Given no annotations or output schema, the description covers all necessary details: operation, auto-detection, bug workaround, example, return format, and parameters. It is sufficiently complete for effective tool use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description includes an 'Args' section that explains each of the four parameters, adding meaning beyond the schema's type and required fields.

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 moves a module to a folder and optionally renames it, with specific details about auto-detection and a two-step operation. It effectively distinguishes from siblings like 'move_module' and 'rename_symbol'.

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 context for when to use the tool, including example and auto-detection behavior. However, it could explicitly differentiate from sibling tools like 'move_module', though the intent is largely inferred.

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/krystofbe/rope-mcp-server'

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