1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * This file is part of the Nexus MCP SDK package.
7: *
8: * (c) 2026 John Paul E. Balandan, CPA <paulbalandan@gmail.com>
9: *
10: * For the full copyright and license information, please view
11: * the LICENSE file that was distributed with this source code.
12: */
13:
14: namespace Nexus\Mcp\Core\Schema\Notification;
15:
16: use Nexus\Assert\Assert;
17: use Nexus\Mcp\Core\Schema\JsonRpc\JsonRpcNotification;
18: use Nexus\Mcp\Core\Schema\NotificationParams\ElicitationCompleteNotificationParams;
19:
20: /**
21: * An optional notification from the server to the client, informing it of
22: * a completion of a out-of-band elicitation request.
23: *
24: * @extends JsonRpcNotification<'notifications/elicitation/complete'>
25: *
26: * @see https://modelcontextprotocol.io/specification/2025-11-25/schema#elicitationcompletenotification
27: */
28: final readonly class ElicitationCompleteNotification extends JsonRpcNotification implements ServerNotification
29: {
30: public function __construct(ElicitationCompleteNotificationParams $params)
31: {
32: parent::__construct($params);
33: }
34:
35: #[\Override]
36: public static function getMethod(): string
37: {
38: return 'notifications/elicitation/complete';
39: }
40:
41: #[\Override]
42: public static function fromArray(array $data): static
43: {
44: Assert::that($data)->hasOffset('params', 'missing the required "params" key.');
45: Assert::that($data['params'])
46: ->isArray('"params" must be an object, {type} given.')
47: ->isMap('"params" must be a string-keyed object.')
48: ;
49:
50: return new self(ElicitationCompleteNotificationParams::fromArray($data['params']));
51: }
52: }
53: