Skip to main content
Glama

module_to_package

Converts a Python module file into a package by creating a directory for it and moving the module to init.py, rewriting relative imports as absolute. Preview changes with dry-run; set apply=true to execute.

Instructions

Convert a Python module file into a package: creates a directory of the module's name and moves the module to its init.py, rewriting relative imports to absolute. Pass the module's file path alone; no Position needed. Defaults to a Dry Run preview (created and moved entries appear in the Blast Radius); set apply=true to write. Use your LSP for navigation and reading; this tool only restructures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYes
rootNo
applyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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 well: it discloses the steps (creates directory, moves module, rewrites imports), the dry-run default, and the apply flag to write. It also clarifies the tool's scope ('only restructures'), preventing misuse. No annotation contradictions exist.

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 four concise sentences, each with a clear informational role: purpose/mechanism, parameter guidance, dry-run behavior, and scope limitation. Every sentence earns its place with no repetition or filler.

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?

The description is complete for the core use case: it explains what the tool does, how to invoke it, and its safety default (dry run). The output schema exists, so return values are not needed. However, it omits edge cases such as handling conflicts (e.g., directory already exists) and does not explain the 'Blast Radius' term, nor the 'root' parameter's role, leaving minor gaps.

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 0%, so the description must compensate. It explains 'file' (pass the file path alone) and 'apply' (set apply=true to write), but says nothing about the optional 'root' parameter. While root is optional with a default, its purpose remains ambiguous, leaving one of three parameters semantically unexplained.

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 a specific verb and resource: 'Convert a Python module file into a package,' followed by a clear mechanism (creates directory, moves module to __init__.py, rewrites relative imports). This clearly differentiates it from sibling refactoring tools like move or rename.

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 usage guidance: 'Pass the module's file path alone; no Position needed' distinguishes it from tools requiring positional arguments. It also states 'Use your LSP for navigation and reading; this tool only restructures,' which is an explicit when-not-to-use. The dry-run default and apply=true instruction further clarify how to execute the operation.

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/andrewesweet/ropey'

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