MCP PHP SDK

SchemaGeneratorInterface

Provides JSON Schema generation for reflected elements.

Tags
author

Antoine Bluchet soyuka@gmail.com

Table of Contents

Methods

generate()  : array{type: "object", properties: array|object, required?: string[]}
Generates a JSON Schema for input parameters.
generateOutputSchema()  : array<string, mixed>|null
Generates a JSON Schema for output/result.

Methods

generate()

Generates a JSON Schema for input parameters.

public generate(Reflector $reflection) : array{type: "object", properties: array|object, required?: string[]}

The returned schema must be a valid JSON Schema object (type: 'object') with properties corresponding to a tool's parameters.

Parameters
$reflection : Reflector
Return values
array{type: "object", properties: array|object, required?: string[]}

generateOutputSchema()

Generates a JSON Schema for output/result.

public generateOutputSchema(Reflector $reflection) : array<string, mixed>|null
Parameters
$reflection : Reflector
Return values
array<string, mixed>|null

        
On this page

Search results