Skip to main content
Glama
maschmann

symfony-php-mcp

by maschmann

read_code_context

Reads a Symfony project file, optionally stripping doc and line comments to reduce token usage for faster analysis.

Instructions

Read a file from the Symfony project, with optional comment stripping.

Stripping PHPDoc / block comments (/* ... */) significantly reduces token usage without losing functional information – use strip_doc_comments=true (the default) for faster, cheaper analysis.

Args: file_path: Path relative to the project root. Examples: "src/Controller/UserController.php" "src/Entity/User.php" Absolute paths inside the project are also accepted. strip_doc_comments: Remove /** ... / and / ... */ blocks. Default: true. strip_line_comments: Also remove // single-line comments. Default: false (inline comments are useful context).

Returns the file content with line numbers and a token-savings summary.

Security: only files inside the project root can be read (path traversal is blocked).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
strip_doc_commentsNo
strip_line_commentsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully covers behavioral traits: it explains the default stripping behavior, token savings, security (path traversal blocked), and return format (line numbers, savings summary). 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 well-structured with an Args section, Returns line, and Security note. Every sentence adds value without redundancy. It is concise yet complete.

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?

The description covers the tool's purpose, parameters, behavior, return content, and security. Given the low complexity and presence of an output schema (though not shown), the description is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description adds extensive meaning: file_path includes examples and accepted formats, strip_doc_comments explains benefits and default, strip_line_comments clarifies context. This compensates fully.

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 reads a file from the Symfony project with optional comment stripping. The verb 'Read' and resource 'file from the Symfony project' are specific, and it distinguishes from siblings like analyze_twig or search_code.

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 offers some usage guidance (e.g., using strip_doc_comments=true for faster analysis) and security constraints, but does not explicitly state when to use this tool versus siblings. It lacks direct comparisons or when-not scenarios.

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/maschmann/symfony-php-mcp'

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