DiscoveryState
FinalYes
Represents the state of discovered MCP capabilities.
This class encapsulates all discovered elements (tools, resources, prompts, resource templates) and provides methods to apply this state to a registry.
Tags
Table of Contents
Properties
- $prompts : array<string|int, mixed>
- $resources : array<string|int, mixed>
- $resourceTemplates : array<string|int, mixed>
- $tools : array<string|int, mixed>
Methods
- __construct() : mixed
- getElementCount() : int
- Get the total count of discovered elements.
- getElementCounts() : array{tools: int, resources: int, prompts: int, resourceTemplates: int}
- Get a breakdown of discovered elements by type.
- getPrompts() : array<string, PromptReference>
- getResources() : array<string, ResourceReference>
- getResourceTemplates() : array<string, ResourceTemplateReference>
- getTools() : array<string, ToolReference>
- isEmpty() : bool
- Check if this state contains any discovered elements.
Properties
$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, ToolReference> $tools = [] ][, array<string, ResourceReference> $resources = [] ][, array<string, PromptReference> $prompts = [] ][, array<string, ResourceTemplateReference> $resourceTemplates = [] ]) : mixed
Parameters
- $tools : array<string, ToolReference> = []
- $resources : array<string, ResourceReference> = []
- $prompts : array<string, PromptReference> = []
- $resourceTemplates : array<string, ResourceTemplateReference> = []
getElementCount()
Get the total count of discovered elements.
public
getElementCount() : int
Return values
intgetElementCounts()
Get a breakdown of discovered elements by type.
public
getElementCounts() : array{tools: int, resources: int, prompts: int, resourceTemplates: int}
Return values
array{tools: int, resources: int, prompts: int, resourceTemplates: int}getPrompts()
public
getPrompts() : array<string, PromptReference>
Return values
array<string, PromptReference>getResources()
public
getResources() : array<string, ResourceReference>
Return values
array<string, ResourceReference>getResourceTemplates()
public
getResourceTemplates() : array<string, ResourceTemplateReference>
Return values
array<string, ResourceTemplateReference>getTools()
public
getTools() : array<string, ToolReference>
Return values
array<string, ToolReference>isEmpty()
Check if this state contains any discovered elements.
public
isEmpty() : bool