Recommend this page to a friend! |
Classes of Mohamed Ahmed | Laravel MCP SDK | docs/api/_ToolsCapability.md | Download |
|
![]() ToolsCapabilityNamespace: `` Represents the tools capability in the MCP system. This class manages information about changes to the available tools in the MCP system. It tracks whether the list of tools has been modified and provides methods to serialize and deserialize this state. Tools Capability Features: - Tool list change tracking - State serialization/deserialization - Change notification support Use Cases: - Detecting when tools are added or removed - Synchronizing tool lists between client and server - Managing tool state across sessions Example Usage:
@package LaravelMCP\MCP\Capabilities Methods__constructCreate a new tools capability instance. Initializes a tools capability tracker that monitors changes to the available tools in the MCP system. Example:
@param bool|null $listChanged Whether the list of tools has changed
getListChangedGet whether the list of tools has changed. Retrieves the current state of tool list modifications. This can be used to determine if the available tools have been updated since the last synchronization. Example:
@return bool|null True if the list has changed, false if not, null if unknown toArrayConvert the capability to an array format. Transforms the tools capability state into a structured array suitable for storage or transmission. Only includes the listChanged property if it has been set to a non-null value. Example output:
@return array The capability data as a key-value array createCreate a new instance from an array of data. Factory method that constructs a ToolsCapability instance from a configuration array. This is useful for deserializing stored configurations or processing API responses. Example:
@param array $data The data to create the instance from @return static A new instance of the capability |