MCP PHP SDK

RegistryInterface

Tags
phpstan-import-type

Handler from ElementReference

author

Kyrian Obikwelu koshnawaza@gmail.com

author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Methods

clear()  : void
Clear discovered elements from registry.
getDiscoveryState()  : DiscoveryState
Get the current discovery state (only discovered elements, not manual ones).
getPrompt()  : PromptReference
Gets a prompt reference by name.
getPrompts()  : Page
Gets all registered prompts.
getResource()  : ResourceReference|ResourceTemplateReference
Gets a resource reference by URI (includes template matching if enabled).
getResources()  : Page
Gets all registered resources.
getResourceTemplate()  : ResourceTemplateReference
Gets a resource template reference by URI template.
getResourceTemplates()  : Page
Gets all registered resource templates.
getTool()  : ToolReference
Gets a tool reference by name.
getTools()  : Page
Gets all registered tools.
hasPrompts()  : bool
hasResources()  : bool
hasResourceTemplates()  : bool
hasTools()  : bool
registerPrompt()  : void
Registers a prompt with its handler and completion providers.
registerResource()  : void
Registers a resource with its handler.
registerResourceTemplate()  : void
Registers a resource template with its handler and completion providers.
registerTool()  : void
Registers a tool with its handler.
setDiscoveryState()  : void
Set discovery state, replacing all discovered elements.

Methods

getPrompts()

Gets all registered prompts.

public getPrompts([int|null $limit = null ][, string|null $cursor = null ]) : Page
Parameters
$limit : int|null = null
$cursor : string|null = null
Return values
Page

getResources()

Gets all registered resources.

public getResources([int|null $limit = null ][, string|null $cursor = null ]) : Page
Parameters
$limit : int|null = null
$cursor : string|null = null
Return values
Page

getResourceTemplates()

Gets all registered resource templates.

public getResourceTemplates([int|null $limit = null ][, string|null $cursor = null ]) : Page
Parameters
$limit : int|null = null
$cursor : string|null = null
Return values
Page

getTools()

Gets all registered tools.

public getTools([int|null $limit = null ][, string|null $cursor = null ]) : Page
Parameters
$limit : int|null = null
$cursor : string|null = null
Return values
Page

hasPrompts()

public hasPrompts() : bool
Return values
bool

true if any prompts are registered

hasResources()

public hasResources() : bool
Return values
bool

true if any resources are registered

hasResourceTemplates()

public hasResourceTemplates() : bool
Return values
bool

true if any resource templates are registered

hasTools()

public hasTools() : bool
Return values
bool

true if any tools are registered

registerPrompt()

Registers a prompt with its handler and completion providers.

public registerPrompt(Prompt $prompt, Handler $handler[, array<string, class-string|object> $completionProviders = [] ][, bool $isManual = false ]) : void
Parameters
$prompt : Prompt
$handler : Handler
$completionProviders : array<string, class-string|object> = []
$isManual : bool = false

registerResource()

Registers a resource with its handler.

public registerResource(Resource $resource, Handler $handler[, bool $isManual = false ]) : void
Parameters
$resource : Resource
$handler : Handler
$isManual : bool = false

registerResourceTemplate()

Registers a resource template with its handler and completion providers.

public registerResourceTemplate(ResourceTemplate $template, Handler $handler[, array<string, class-string|object> $completionProviders = [] ][, bool $isManual = false ]) : void
Parameters
$template : ResourceTemplate
$handler : Handler
$completionProviders : array<string, class-string|object> = []
$isManual : bool = false

registerTool()

Registers a tool with its handler.

public registerTool(Tool $tool, Handler $handler[, bool $isManual = false ]) : void
Parameters
$tool : Tool
$handler : Handler
$isManual : bool = false

        
On this page

Search results