Skip to main content
Glama

Generate PHP Controller

scaffold_controller

Generate a PHP controller for a resource that delegates all logic to its Service layer, keeping zero queries and zero inline validation. Skips existing files unless overwrite is enabled.

Instructions

Generates a PHP Controller for a resource (presentation layer only). The controller only calls the corresponding Service: zero queries and zero inline validation. Does not overwrite existing files unless overwrite=true.

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": {
      "resourceName": "<resourceName>"
    },
    "name": "scaffold_controller"
  }
}

Input Schema

NameRequiredDescriptionDefault
fieldsNo
methodsNo
overwriteNo
resourceNameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations present, the description carries the full burden and does disclose useful behavior: no queries, no inline validation, and no overwriting unless overwrite=true. It omits where files are written, what happens on a name collision when overwrite is false (error vs. silent skip), and whether routes or DI bindings are touched, all of which matter for a filesystem-mutating tool.

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?

Three short sentences, front-loaded with the output artifact and its architectural scope before the non-overwrite safety note. No filler and no restatement of the tool name.

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

Completeness3/5

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

For a file-generating mutation tool with no annotations and no output schema, the definition covers the architectural contract and overwrite safety but not the return value, the target directory, or the failure mode on existing files. An agent could invoke it, but would not know what to expect back after the call.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it only clarifies the overwrite flag (default behavior is non-destructive). The resourceName pattern/length, the fields array with its validation strings, and the methods enum are left entirely to the schema, which is self-documenting via enums, defaults, and patterns but never explains what a validation string should contain.

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 names a specific verb and resource ("Generates a PHP Controller") and scopes it with "(presentation layer only)," which meaningfully separates it from scaffold_service and scaffold_repository siblings. It stops short of naming those siblings explicitly, so an agent must infer the boundary from the parenthetical rather than from a direct routing statement.

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?

Usage is implied by the presentation-layer scope and the note that the controller only calls the corresponding Service, which hints this pairs with a service-generation step. However, there is no explicit when-to-use vs. when-not guidance and no mention of scaffold_full_resource as the alternative for end-to-end generation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.