Skip to main content
Glama
krystofbe

rope-mcp-server

by krystofbe

convert_module_to_package

Convert a Python module file into a package by moving it to a subdirectory and updating all imports project-wide.

Instructions

Convert a module file into a package with the same name.

Transforms foo.py into foo/foo.py while updating all imports project-wide.

Example: views/service_contractor.py becomes views/service_contractor/service_contractor.py All imports like from views.service_contractor import X become from views.service_contractor.service_contractor import X

This is a two-step process using Rope:

  1. Move module to a temporary package (different name to trigger import updates)

  2. Rename the temporary package to the original module name

Args: project_path: Root directory of the Python project module_path: Path to module file (relative to project_path), e.g. "app/views/foo.py"

Returns: JSON with success status and list of changed files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
module_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Without annotations, the description fully explains the two-step Rope process and the impact of updating imports project-wide. It provides a clear example and steps, though it omits potential edge cases like collisions or irreversible changes.

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?

The description is well-structured with a main sentence, example, steps, and returns. It is slightly verbose but remains efficient and front-loaded with the core purpose.

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 the tool has only 2 parameters, an output schema (as per context signals), and the description includes return format, the description is fully complete for an agent to invoke correctly.

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?

Despite 0% schema description coverage, the description includes an Args section that explains project_path and module_path with concrete examples, adding meaning beyond the schema's bare type definitions.

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 verb 'convert' and resource 'module file into a package', with an explicit example distinguishing it from siblings like move_module or rename_symbol. It is specific and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for converting modules to packages, but does not explicitly state when to use it versus alternatives like move_module. No exclusions or prerequisite conditions are provided, leaving the agent to infer usage context.

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