name() ] = $tool; } /** * Get a registered tool by name. */ public static function get( string $name ): ?Tool { return self::$tools[ $name ] ?? null; } /** * Return metadata for all registered tools. */ public static function get_schemas(): array { return array_map( function ( Tool $tool ) { return array( 'name' => $tool->name(), 'description' => $tool->description(), 'input_schema' => $tool->input_schema(), ); }, self::$tools ); } /** * Return all registered tools. * * @return Tool[] */ public static function all(): array { return self::$tools; } /** * Clear the registry. Mainly useful for tests. */ public static function clear(): void { self::$tools = array(); } }