MCP PHP SDK

SchemaGeneratorInterface

Provides JSON Schema generation for reflected elements.

Tags
phpstan-import-type

ToolInputSchema from Tool

author

Antoine Bluchet soyuka@gmail.com

Table of Contents

Methods

generate()  : ToolInputSchema
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) : ToolInputSchema

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
ToolInputSchema

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