Skip to main content
Glama

Generate PHP Controller

scaffold_controller

Generate a PHP controller that delegates to a service, avoiding queries and inline validation. Existing files remain untouched 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodsNo
overwriteNo
resourceNameYes
Behavior4/5

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

With no annotations, the description carries the burden. It discloses key behavior: generates a controller with zero queries and zero inline validation, and overwrite behavior. However, it does not state what happens when a file exists and overwrite=false (error, skip, etc.), which is a minor gap.

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?

Two sentences, front-loaded with the main action and scope. Every sentence adds value: the first clarifies purpose and constraints, the second handles overwrite behavior. No wasted words.

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

Completeness4/5

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

The description is sufficient for a simple scaffolding tool with no output schema. It covers what the generated controller does, its scope, and overwrite behavior. It lacks details on file destination or naming conventions, but the presence of sibling tools and resourceName helps infer context.

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 description coverage is 0%, so the description must compensate. It adds meaning to `overwrite` (does not overwrite unless true) but not to `methods` or `resourceName`. The schema's enums and pattern provide some self-describing structure, but the description doesn't explain how methods map to generated code or validate naming conventions.

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 it 'Generates a PHP Controller for a resource' with the scope 'presentation layer only', which is a specific verb+resource. It distinguishes from sibling scaffolds by emphasizing the controller only calls the corresponding Service, with zero queries and zero inline validation.

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 provides clear context: it is for presentation layer controllers that delegate solely to services. It implies the tool is not for creating full resource stacks or services/repositories, but does not explicitly name alternatives or exclusion criteria, so a slight deduction.

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/X-Gunner/codeigniter-mcp'

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