MCP PHP SDK

AbstractSchemaDefinition implements JsonSerializable

AbstractYes

Base class for schema definitions in elicitation requests.

Tags
author

Johannes Wachter johannes@sulu.io

Table of Contents

Interfaces

JsonSerializable

Properties

$description  : string|null
$title  : string

Methods

__construct()  : mixed
jsonSerialize()  : array<string, mixed>
buildBaseJson()  : array<string, mixed>
Build the base JSON structure with type, title, and optional description.
validateTitle()  : void
Validate that title exists and is a string in the data array.

Properties

Methods

__construct()

public __construct(string $title[, string|null $description = null ]) : mixed
Parameters
$title : string
$description : string|null = null

jsonSerialize()

public abstract jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

buildBaseJson()

Build the base JSON structure with type, title, and optional description.

protected buildBaseJson(string $type) : array<string, mixed>
Parameters
$type : string
Return values
array<string, mixed>

validateTitle()

Validate that title exists and is a string in the data array.

protected static validateTitle(array<string, mixed> $data, string $schemaType) : void
Parameters
$data : array<string, mixed>
$schemaType : string
Tags
throws
InvalidArgumentException

        
On this page

Search results