Skip to main content
Glama

Run PHP Mess Detector (PHPMD)

run_phpmd
Read-onlyIdempotent

Analyze PHP code with PHPMD to detect complexity, dead code, design flaws, and naming violations.

Instructions

PHPMD ile kod karmaşıklığı, kullanılmayan kod, tasarım sorunları ve adlandırma ihlallerini raporlar.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoÇıktı formatı. Varsayılan: text.text
filepathYesPHPMD tarafından taranacak dosya veya dizin. Örnek: ./src
rulesetsNoKullanılacak kurallar. Varsayılan: cleancode,codesize,design,naming,unusedcode.
projectPathNoİsteğe bağlı proje kökü (otomatik tespit edilir).
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the agent knows it's safe. The description adds value by specifying the specific analysis categories (complexity, unused code, design issues, naming), which go beyond the annotations and inform the agent about what behavioral checks are performed.

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 a single, concise sentence with no wasted words. It is front-loaded with the tool's purpose. However, it could be more comprehensive by mentioning the required filepath parameter without significantly increasing length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is minimal for a tool with multiple parameters and no output schema. It does not explain that results are returned in a configurable format (text, json, etc.), nor does it mention the need for a filepath or rulesets. Given the tool's complexity, more context is needed for an agent to use it effectively.

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 descriptions for all parameters. The tool description does not add any additional meaning to the parameters beyond what the schema already provides. Thus, baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reports code complexity, unused code, design issues, and naming violations using PHPMD. It uses a specific verb ('reports') and resource ('code issues'), distinguishing it from sibling tools like run_phpcs (coding standards) or run_phpinsights (overall quality). However, it could be more explicit about the action of running PHPMD on a file/directory.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus other similar analysis tools (e.g., run_phpcs, run_phpinsights). There is no mention of prerequisites, context, or exclusions, leaving the agent to infer usage from the tool name alone.

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/halitartuc/phpustik'

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