MCP PHP SDK

ArrayLoader implements LoaderInterface

FinalYes
Tags
author

Antoine Bluchet soyuka@gmail.com

phpstan-import-type

Handler from ElementReference

Table of Contents

Interfaces

LoaderInterface

Properties

$logger  : LoggerInterface
$prompts  : array<string|int, mixed>
$resources  : array<string|int, mixed>
$resourceTemplates  : array<string|int, mixed>
$schemaGenerator  : SchemaGeneratorInterface|null
$tools  : array<string|int, mixed>

Methods

__construct()  : mixed
load()  : void
getCompletionProviders()  : array<string, ProviderInterface>
getHandlerDescription()  : string

Properties

$logger

private LoggerInterface $logger = new NullLogger()

$prompts read-only

private array<string|int, mixed> $prompts = []

$resources read-only

private array<string|int, mixed> $resources = []

$resourceTemplates read-only

private array<string|int, mixed> $resourceTemplates = []

$tools read-only

private array<string|int, mixed> $tools = []

Methods

__construct()

public __construct([array<string|int, Icon[], meta: ?array, outputSchema: ?array}$tools = [] ][, array<string|int, Icon[], meta: ?array}$resources = [] ][, array<string|int, Annotations, meta: ?array}$resourceTemplates = [] ][, array<string|int, Icon[], meta: ?array}$prompts = [] ][, LoggerInterface $logger = new NullLogger() ][, SchemaGeneratorInterface|null $schemaGenerator = null ]) : mixed
Parameters
$tools : array<string|int, Icon[], meta: ?array, outputSchema: ?array}> = []
$resources : array<string|int, Icon[], meta: ?array}> = []
$resourceTemplates : array<string|int, Annotations, meta: ?array}> = []
$prompts : array<string|int, Icon[], meta: ?array}> = []
$logger : LoggerInterface = new NullLogger()
$schemaGenerator : SchemaGeneratorInterface|null = null

getCompletionProviders()

private getCompletionProviders(ReflectionMethod|ReflectionFunction $reflection) : array<string, ProviderInterface>
Parameters
$reflection : ReflectionMethod|ReflectionFunction
Return values
array<string, ProviderInterface>

getHandlerDescription()

private getHandlerDescription(Handler $handler) : string
Parameters
$handler : Handler
Return values
string

        
On this page

Search results