analyze_twig
Analyzes Twig templates to extract inheritance, includes, imports, blocks, and variable references without requiring PHP execution.
Instructions
Analyse a Twig template and return its structural metadata.
No PHP execution required – pure filesystem analysis.
Extracts:
extends parent (inheritance chain)
{% include %} and {% embed %} directives
{% import %} and {% from ... import %} macro imports
{% block %} definitions
Template variables referenced in {{ }} expressions
Args: template_name: Template path as used in Twig (e.g. "user/show.html.twig") or a partial name (e.g. "show" or "user/show"). The templates/ directory is searched recursively.
Returns a structured Markdown report.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"template_name": "<template_name>"
},
"name": "analyze_twig"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |