Skip to main content
Glama

Format PHP Code (PHP-CS-Fixer)

format_php_code
DestructiveIdempotent

Format PHP code according to PSR-12 standards. Preview changes with dry run or apply formatting directly, with optional backup of original file.

Instructions

PHP-CS-Fixer (PSR-12) ile bir PHP dosyasını formatlar. 'dryRun' true ise sadece diff gösterir, false ise dosyayı yerinde günceller.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dryRunNoSadece önizleme diff gösterir (true). Dosyayı yazmak için false kullanın.
filepathYesFormatlanacak PHP dosyasının yolu. Örnek: ./src/Foo.php
createBackupNoFormat öncesi orijinali geçici bir dizine yedekler. Varsayılan: false.
Behavior5/5

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

The description discloses key behaviors: dry-run mode vs actual write, backup option, and uses PHP-CS-Fixer. Annotations already indicate destructiveHint=true and idempotentHint=true; the description adds contextual detail about what happens in each mode, with no contradiction.

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 a single, front-loaded sentence that conveys essential behavior without fluff. Every word is informative, making it easy to scan.

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 high schema coverage, lack of output schema, and clear annotations, the description covers all necessary behavioral aspects. No gaps remain for an agent to safely invoke this tool.

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% and already describes each parameter (dryRun, filepath, createBackup) in detail. The description adds minimal new information beyond restating the dry run behavior. Baseline 3 is appropriate as the schema carries the load.

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 formats a PHP file using PHP-CS-Fixer (PSR-12) and distinguishes between showing a diff (dryRun) and updating the file in place. This specific verb-resource pairing differentiates it from sibling tools like lint_php_file or run_phpcs.

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 explains when dryRun is true vs false, which implies usage contexts. However, it does not explicitly contrast with alternative tools (e.g., lint_php_file for checks vs this for fixes) or state when not to use it. Still, the purpose is clear enough for correct invocation.

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