php-sdk/tests/Integration/Fixture/Completion/BookingElements.php
Christopher Hertel f39625b257
[Capability] Remove CompletionProvider's dead providerClass argument (#499)
* [Capability] Remove CompletionProvider's dead providerClass argument

It always threw on construction, so it never worked in any release. `provider:`
takes the same class-string and is now the first positional argument.

* Reword Changelog
2026-09-07 23:27:53 +02:00

38 lines
940 B
PHP

<?php
/*
* This file is part of the official PHP MCP SDK.
*
* A collaboration between Symfony and the PHP Foundation.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mcp\Tests\Integration\Fixture\Completion;
use Mcp\Capability\Attribute\CompletionProvider;
use Mcp\Capability\Attribute\McpPrompt;
/**
* @author Christopher Hertel <mail@christopher-hertel.de>
*/
final class BookingElements
{
/**
* Confirms a seat booking.
*
* @param string $seat the seat to book
*
* @return array the prompt messages
*/
#[McpPrompt(name: 'book_seat')]
public function bookSeat(
#[CompletionProvider(provider: SeatCompletionProvider::class)]
string $seat,
): array {
return [
['role' => 'user', 'content' => \sprintf('Book seat %s for me.', $seat)],
];
}
}