Skip to main content
Glama
p4it-kft

Phpactor MCP Server

by p4it-kft

phpactor_move_class

Move a PHP class file, update its namespace, and automatically refactor all project-wide references. Writes directly to disk – commit your work first.

Instructions

Move/rename a PHP class: moves the file, updates the namespace declaration, AND updates all references project-wide. This is the tool for full class renames. WARNING: Writes directly to disk — commit your work first!

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destPathYesAbsolute path to the destination PHP file
sourcePathYesAbsolute path to the source PHP file
projectPathYesAbsolute path to the PHP project root
Behavior4/5

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

With no annotations, the description carries the full burden. It explicitly states that the tool writes directly to disk and updates references project-wide, which is crucial behavioral information. It does not cover all aspects (e.g., rollback, permissions), but the warning about committing work provides adequate transparency for safe use.

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 with no wasted words. The first sentence front-loads the main action and its effects, the second summarizes the purpose, and the third provides a critical warning. Excellent structure and conciseness.

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?

Given the tool's complexity (project-wide modifications) and lack of output schema, the description covers key aspects: what it does, the full impact, and a safety warning. It could mention error handling or performance, but overall it is sufficiently complete for an AI agent to use 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 coverage is 100% with clear descriptions for all three parameters. The description briefly adds context about moving and renaming, but does not significantly enhance meaning beyond the schema (e.g., format constraints, validation rules). Baseline 3 is appropriate.

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 (Move/rename), resource (PHP class), and specific actions (moves file, updates namespace, updates all references project-wide). It also explicitly says 'This is the tool for full class renames,' distinguishing it from siblings like phpactor_rename_class.

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 includes a warning to commit work first and states it's for full class renames, giving usage context. However, it does not explicitly mention when not to use this tool or provide alternatives like phpactor_rename_class for cases where only renaming without moving is needed.

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/p4it-kft/p4it-phpactor-mcp'

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