feat: let get_trip resolve a date code to its trip and date
This commit is contained in:
1 parent
754360605c
commit
3af41c06ab
4 files changed
+45
-9
No files matched your search
@@ -14,7 +14,7 @@ use Mcp\Schema\ToolAnnotations;
|
||||
|
||||
#[McpTool(
|
||||
name: 'get_trip',
|
||||
description: 'Full details of one trip: description, included services, programme, hotel, all upcoming dates with rooms, prices per person in EUR and availability, pickup points and departure times, FAQs. Use after search_trips, or when the user names a specific trip. Prices and availability are a snapshot as of dataAsOf; the booking page is binding.',
|
||||
description: 'Full details of one trip: description, included services, programme, hotel, all upcoming dates with rooms, prices per person in EUR and availability, pickup points and departure times, FAQs. Use after search_trips, or when the user names a specific trip or a booked date (date codes such as SSLMP061226 narrow the answer to that date). Prices and availability are a snapshot as of dataAsOf; the booking page is binding.',
|
||||
annotations: new ToolAnnotations(readOnlyHint: true, openWorldHint: false),
|
||||
)]
|
||||
final class GetTripTool
|
||||
@@ -26,7 +26,7 @@ final class GetTripTool
|
||||
}
|
||||
|
||||
public function __invoke(
|
||||
#[Schema(description: 'Trip code, as returned by search_trips.', minLength: 1)]
|
||||
#[Schema(description: 'Trip code as returned by search_trips, or a date code (dateCode) for one date of a trip.', minLength: 1)]
|
||||
string $code,
|
||||
#[Schema(description: 'Narrows the dates to one hotel when a trip has several.')]
|
||||
?string $hotelCode = null,
|
||||
@@ -35,7 +35,7 @@ final class GetTripTool
|
||||
$trip = $this->catalog->get(trim($code), $hotelCode);
|
||||
|
||||
if (null === $trip) {
|
||||
throw new ToolCallException(sprintf('No trip with code "%s". Use search_trips to find trip codes.', $code));
|
||||
throw new ToolCallException(sprintf('No trip or date with code "%s". Use search_trips to find trip codes.', $code));
|
||||
}
|
||||
|
||||
return $trip;
|
||||
|
||||
Reference in new issue
Block a user