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\Server\Attribute;
15:
16: /**
17: * Marks a method as a completion provider for one prompt argument or resource template
18: * variable, registered through `ServerBuilder::register()`.
19: */
20: #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
21: final readonly class AsCompletion
22: {
23: /**
24: * @param string $argument Name of the prompt argument or template variable being completed
25: * @param null|string $prompt Name of the prompt the argument belongs to
26: * @param null|string $uriTemplate URI template the variable belongs to
27: */
28: public function __construct(
29: public string $argument,
30: public ?string $prompt = null,
31: public ?string $uriTemplate = null,
32: ) {
33: }
34: }
35: