Last active
September 19, 2025 07:26
-
-
Save shivamMg/857c73310e418d9701b081d2da236b62 to your computer and use it in GitHub Desktop.
Airline and Retail API OpenAPI (Swagger) Specifications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "openapi": "3.0.3", | |
| "info": { | |
| "title": "Airline Tools API", | |
| "version": "1.0.0" | |
| }, | |
| "paths": { | |
| "/reservations": { | |
| "post": { | |
| "operationId": "book_reservation", | |
| "description": "Book a reservation.", | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/BookReservationRequest" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Book a reservation." | |
| } | |
| } | |
| } | |
| }, | |
| "/calculate": { | |
| "post": { | |
| "operationId": "calculate", | |
| "description": "Calculate the result of a mathematical expression.", | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/CalculateRequest" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Calculate the result of a mathematical expression." | |
| } | |
| } | |
| } | |
| }, | |
| "/reservations/{reservation_id}": { | |
| "get": { | |
| "operationId": "get_reservation_details", | |
| "description": "Get the details of a reservation.", | |
| "parameters": [ | |
| { | |
| "name": "reservation_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The reservation id, such as '8JX2WO'." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Get the details of a reservation." | |
| } | |
| } | |
| }, | |
| "delete": { | |
| "operationId": "cancel_reservation", | |
| "description": "Cancel the whole reservation.", | |
| "parameters": [ | |
| { | |
| "name": "reservation_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The reservation ID, such as 'ZFA04Y'." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Cancel the whole reservation." | |
| } | |
| } | |
| } | |
| }, | |
| "/users/{user_id}": { | |
| "get": { | |
| "operationId": "get_user_details", | |
| "description": "Get the details of an user.", | |
| "parameters": [ | |
| { | |
| "name": "user_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The user id, such as 'sara_doe_496'." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Get the details of an user." | |
| } | |
| } | |
| } | |
| }, | |
| "/airports": { | |
| "get": { | |
| "operationId": "list_all_airports", | |
| "description": "List all airports and their cities.", | |
| "responses": { | |
| "200": { | |
| "description": "List all airports and their cities." | |
| } | |
| } | |
| } | |
| }, | |
| "/flights/direct": { | |
| "get": { | |
| "operationId": "search_direct_flight", | |
| "description": "Search direct flights between two cities on a specific date.", | |
| "parameters": [ | |
| { | |
| "name": "origin", | |
| "in": "query", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The origin city airport in three letters, such as 'JFK'." | |
| }, | |
| { | |
| "name": "destination", | |
| "in": "query", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The destination city airport in three letters, such as 'LAX'." | |
| }, | |
| { | |
| "name": "date", | |
| "in": "query", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Search direct flights between two cities on a specific date." | |
| } | |
| } | |
| } | |
| }, | |
| "/flights/onestop": { | |
| "get": { | |
| "operationId": "search_onestop_flight", | |
| "description": "Search direct flights between two cities on a specific date.", | |
| "parameters": [ | |
| { | |
| "name": "origin", | |
| "in": "query", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The origin city airport in three letters, such as 'JFK'." | |
| }, | |
| { | |
| "name": "destination", | |
| "in": "query", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The destination city airport in three letters, such as 'LAX'." | |
| }, | |
| { | |
| "name": "date", | |
| "in": "query", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Search direct flights between two cities on a specific date." | |
| } | |
| } | |
| } | |
| }, | |
| "/users/{user_id}/certificates": { | |
| "post": { | |
| "operationId": "send_certificate", | |
| "description": "Send a certificate to a user. Be careful!", | |
| "parameters": [ | |
| { | |
| "name": "user_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The ID of the user to book the reservation, such as 'sara_doe_496'." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/SendCertificateRequest" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Send a certificate to a user. Be careful!" | |
| } | |
| } | |
| } | |
| }, | |
| "/support/transfer": { | |
| "post": { | |
| "operationId": "transfer_to_human_agents", | |
| "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/TransferToHumanAgentsRequest" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools." | |
| } | |
| } | |
| } | |
| }, | |
| "/reservations/{reservation_id}/baggages": { | |
| "patch": { | |
| "operationId": "update_reservation_baggages", | |
| "description": "Update the baggage information of a reservation.", | |
| "parameters": [ | |
| { | |
| "name": "reservation_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The reservation ID, such as 'ZFA04Y'." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/UpdateReservationBaggagesRequest" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Update the baggage information of a reservation." | |
| } | |
| } | |
| } | |
| }, | |
| "/reservations/{reservation_id}/flights": { | |
| "patch": { | |
| "operationId": "update_reservation_flights", | |
| "description": "Update the flight information of a reservation.", | |
| "parameters": [ | |
| { | |
| "name": "reservation_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The reservation ID, such as 'ZFA04Y'." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/UpdateReservationFlightsRequest" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Update the flight information of a reservation." | |
| } | |
| } | |
| } | |
| }, | |
| "/reservations/{reservation_id}/passengers": { | |
| "patch": { | |
| "operationId": "update_reservation_passengers", | |
| "description": "Update the passenger information of a reservation.", | |
| "parameters": [ | |
| { | |
| "name": "reservation_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "The reservation ID, such as 'ZFA04Y'." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/UpdateReservationPassengersRequest" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Update the passenger information of a reservation." | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "components": { | |
| "schemas": { | |
| "BookReservationRequest": { | |
| "type": "object", | |
| "required": [ | |
| "user_id", | |
| "origin", | |
| "destination", | |
| "flight_type", | |
| "cabin", | |
| "flights", | |
| "passengers", | |
| "payment_methods", | |
| "total_baggages", | |
| "nonfree_baggages", | |
| "insurance" | |
| ], | |
| "properties": { | |
| "user_id": { | |
| "type": "string", | |
| "description": "The ID of the user to book the reservation, such as 'sara_doe_496'." | |
| }, | |
| "origin": { | |
| "type": "string", | |
| "description": "The IATA code for the origin city, such as 'SFO'." | |
| }, | |
| "destination": { | |
| "type": "string", | |
| "description": "The IATA code for the destination city, such as 'JFK'." | |
| }, | |
| "flight_type": { | |
| "type": "string", | |
| "enum": [ | |
| "one_way", | |
| "round_trip" | |
| ] | |
| }, | |
| "cabin": { | |
| "type": "string", | |
| "enum": [ | |
| "basic_economy", | |
| "economy", | |
| "business" | |
| ] | |
| }, | |
| "flights": { | |
| "type": "array", | |
| "description": "An array of objects containing details about each piece of flight.", | |
| "items": { | |
| "type": "object", | |
| "required": [ | |
| "flight_number", | |
| "date" | |
| ], | |
| "properties": { | |
| "flight_number": { | |
| "type": "string", | |
| "description": "Flight number, such as 'HAT001'." | |
| }, | |
| "date": { | |
| "type": "string", | |
| "description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'." | |
| } | |
| } | |
| } | |
| }, | |
| "passengers": { | |
| "type": "array", | |
| "description": "An array of objects containing details about each passenger.", | |
| "items": { | |
| "type": "object", | |
| "required": [ | |
| "first_name", | |
| "last_name", | |
| "dob" | |
| ], | |
| "properties": { | |
| "first_name": { | |
| "type": "string", | |
| "description": "The first name of the passenger, such as 'Noah'." | |
| }, | |
| "last_name": { | |
| "type": "string", | |
| "description": "The last name of the passenger, such as 'Brown'." | |
| }, | |
| "dob": { | |
| "type": "string", | |
| "description": "The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'." | |
| } | |
| } | |
| } | |
| }, | |
| "payment_methods": { | |
| "type": "array", | |
| "description": "An array of objects containing details about each payment method.", | |
| "items": { | |
| "type": "object", | |
| "required": [ | |
| "payment_id", | |
| "amount" | |
| ], | |
| "properties": { | |
| "payment_id": { | |
| "type": "string", | |
| "description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'." | |
| }, | |
| "amount": { | |
| "type": "number", | |
| "description": "The amount to be paid." | |
| } | |
| } | |
| } | |
| }, | |
| "total_baggages": { | |
| "type": "integer", | |
| "description": "The total number of baggage items included in the reservation." | |
| }, | |
| "nonfree_baggages": { | |
| "type": "integer", | |
| "description": "The number of non-free baggage items included in the reservation." | |
| }, | |
| "insurance": { | |
| "type": "string", | |
| "enum": [ | |
| "yes", | |
| "no" | |
| ] | |
| } | |
| } | |
| }, | |
| "CalculateRequest": { | |
| "type": "object", | |
| "required": [ | |
| "expression" | |
| ], | |
| "properties": { | |
| "expression": { | |
| "type": "string", | |
| "description": "The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces." | |
| } | |
| } | |
| }, | |
| "SendCertificateRequest": { | |
| "type": "object", | |
| "required": [ | |
| "amount" | |
| ], | |
| "properties": { | |
| "amount": { | |
| "type": "number", | |
| "description": "Certificate amount to send." | |
| } | |
| } | |
| }, | |
| "TransferToHumanAgentsRequest": { | |
| "type": "object", | |
| "required": [ | |
| "summary" | |
| ], | |
| "properties": { | |
| "summary": { | |
| "type": "string", | |
| "description": "A summary of the user's issue." | |
| } | |
| } | |
| }, | |
| "UpdateReservationBaggagesRequest": { | |
| "type": "object", | |
| "required": [ | |
| "total_baggages", | |
| "nonfree_baggages", | |
| "payment_id" | |
| ], | |
| "properties": { | |
| "total_baggages": { | |
| "type": "integer", | |
| "description": "The updated total number of baggage items included in the reservation." | |
| }, | |
| "nonfree_baggages": { | |
| "type": "integer", | |
| "description": "The updated number of non-free baggage items included in the reservation." | |
| }, | |
| "payment_id": { | |
| "type": "string", | |
| "description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'." | |
| } | |
| } | |
| }, | |
| "UpdateReservationFlightsRequest": { | |
| "type": "object", | |
| "required": [ | |
| "cabin", | |
| "flights", | |
| "payment_id" | |
| ], | |
| "properties": { | |
| "cabin": { | |
| "type": "string", | |
| "enum": [ | |
| "basic_economy", | |
| "economy", | |
| "business" | |
| ] | |
| }, | |
| "flights": { | |
| "type": "array", | |
| "description": "An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.", | |
| "items": { | |
| "type": "object", | |
| "required": [ | |
| "flight_number", | |
| "date" | |
| ], | |
| "properties": { | |
| "flight_number": { | |
| "type": "string", | |
| "description": "Flight number, such as 'HAT001'." | |
| }, | |
| "date": { | |
| "type": "string", | |
| "description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'." | |
| } | |
| } | |
| } | |
| }, | |
| "payment_id": { | |
| "type": "string", | |
| "description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'." | |
| } | |
| } | |
| }, | |
| "UpdateReservationPassengersRequest": { | |
| "type": "object", | |
| "required": [ | |
| "passengers" | |
| ], | |
| "properties": { | |
| "passengers": { | |
| "type": "array", | |
| "description": "An array of objects containing details about each passenger.", | |
| "items": { | |
| "type": "object", | |
| "required": [ | |
| "first_name", | |
| "last_name", | |
| "dob" | |
| ], | |
| "properties": { | |
| "first_name": { | |
| "type": "string", | |
| "description": "The first name of the passenger, such as 'Noah'." | |
| }, | |
| "last_name": { | |
| "type": "string", | |
| "description": "The last name of the passenger, such as 'Brown'." | |
| }, | |
| "dob": { | |
| "type": "string", | |
| "description": "The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'." | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "openapi": "3.0.3", | |
| "info": { | |
| "title": "Retail Tools API", | |
| "version": "1.0.0" | |
| }, | |
| "paths": { | |
| "/calculate": { | |
| "post": { | |
| "operationId": "calculate", | |
| "description": "Calculate the result of a mathematical expression.", | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/calculate_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Calculate the result of a mathematical expression." | |
| } | |
| } | |
| } | |
| }, | |
| "/orders/{order_id}": { | |
| "get": { | |
| "operationId": "get_order_details", | |
| "description": "Get the status and details of an order.", | |
| "parameters": [ | |
| { | |
| "name": "order_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Get the status and details of an order." | |
| } | |
| } | |
| } | |
| }, | |
| "/orders/{order_id}/cancel": { | |
| "post": { | |
| "operationId": "cancel_pending_order", | |
| "description": "Cancel a pending order. If the order is already processed or delivered, it cannot be cancelled. The agent needs to explain the cancellation detail and ask for explicit user confirmation (yes/no) to proceed. If the user confirms, the order status will be changed to 'cancelled' and the payment will be refunded. The refund will be added to the user's gift card balance immediately if the payment was made using a gift card, otherwise the refund would take 5-7 business days to process. The function returns the order details after the cancellation.", | |
| "parameters": [ | |
| { | |
| "name": "order_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/cancel_pending_order_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Cancel a pending order. If the order is already processed or delivered, it cannot be cancelled. The agent needs to explain the cancellation detail and ask for explicit user confirmation (yes/no) to proceed. If the user confirms, the order status will be changed to 'cancelled' and the payment will be refunded. The refund will be added to the user's gift card balance immediately if the payment was made using a gift card, otherwise the refund would take 5-7 business days to process. The function returns the order details after the cancellation." | |
| } | |
| } | |
| } | |
| }, | |
| "/orders/{order_id}/exchange-items": { | |
| "post": { | |
| "operationId": "exchange_delivered_order_items", | |
| "description": "Exchange items in a delivered order to new items of the same product type. For a delivered order, return or exchange can be only done once by the agent. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", | |
| "parameters": [ | |
| { | |
| "name": "order_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/exchange_delivered_order_items_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Exchange items in a delivered order to new items of the same product type. For a delivered order, return or exchange can be only done once by the agent. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed." | |
| } | |
| } | |
| } | |
| }, | |
| "/orders/{order_id}/return-items": { | |
| "post": { | |
| "operationId": "return_delivered_order_items", | |
| "description": "Return some items of a delivered order. The order status will be changed to 'return requested'. The agent needs to explain the return detail and ask for explicit user confirmation (yes/no) to proceed. The user will receive follow-up email for how and where to return the item.", | |
| "parameters": [ | |
| { | |
| "name": "order_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/return_delivered_order_items_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Return some items of a delivered order. The order status will be changed to 'return requested'. The agent needs to explain the return detail and ask for explicit user confirmation (yes/no) to proceed. The user will receive follow-up email for how and where to return the item." | |
| } | |
| } | |
| } | |
| }, | |
| "/orders/{order_id}/address": { | |
| "patch": { | |
| "operationId": "modify_pending_order_address", | |
| "description": "Modify the shipping address of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", | |
| "parameters": [ | |
| { | |
| "name": "order_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/modify_pending_order_address_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Modify the shipping address of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed." | |
| } | |
| } | |
| } | |
| }, | |
| "/orders/{order_id}/items": { | |
| "patch": { | |
| "operationId": "modify_pending_order_items", | |
| "description": "Modify items in a pending order to new items of the same product type. For a pending order, this function can only be called once. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", | |
| "parameters": [ | |
| { | |
| "name": "order_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/modify_pending_order_items_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Modify items in a pending order to new items of the same product type. For a pending order, this function can only be called once. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed." | |
| } | |
| } | |
| } | |
| }, | |
| "/orders/{order_id}/payment": { | |
| "patch": { | |
| "operationId": "modify_pending_order_payment", | |
| "description": "Modify the payment method of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", | |
| "parameters": [ | |
| { | |
| "name": "order_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/modify_pending_order_payment_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Modify the payment method of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed." | |
| } | |
| } | |
| } | |
| }, | |
| "/products/{product_id}": { | |
| "get": { | |
| "operationId": "get_product_details", | |
| "description": "Get the inventory details of a product.", | |
| "parameters": [ | |
| { | |
| "name": "product_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The product id, such as '6086499569'. Be careful the product id is different from the item id." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Get the inventory details of a product." | |
| } | |
| } | |
| } | |
| }, | |
| "/products/types": { | |
| "get": { | |
| "operationId": "list_all_product_types", | |
| "description": "List the name and product id of all product types. Each product type has a variety of different items with unique item ids and options. There are only 50 product types in the store.", | |
| "responses": { | |
| "200": { | |
| "description": "List the name and product id of all product types. Each product type has a variety of different items with unique item ids and options. There are only 50 product types in the store." | |
| } | |
| } | |
| } | |
| }, | |
| "/users/{user_id}": { | |
| "get": { | |
| "operationId": "get_user_details", | |
| "description": "Get the details of an user.", | |
| "parameters": [ | |
| { | |
| "name": "user_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The user id, such as 'sara_doe_496'." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Get the details of an user." | |
| } | |
| } | |
| } | |
| }, | |
| "/users/{user_id}/address": { | |
| "patch": { | |
| "operationId": "modify_user_address", | |
| "description": "Modify the default address of an user. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", | |
| "parameters": [ | |
| { | |
| "name": "user_id", | |
| "in": "path", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The user id, such as 'sara_doe_496'." | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/modify_user_address_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Modify the default address of an user. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed." | |
| } | |
| } | |
| } | |
| }, | |
| "/users/lookup/email": { | |
| "get": { | |
| "operationId": "find_user_id_by_email", | |
| "description": "Find user id by email. If the user is not found, the function will return an error message.", | |
| "parameters": [ | |
| { | |
| "name": "email", | |
| "in": "query", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The email of the user, such as '[email protected]'." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Find user id by email. If the user is not found, the function will return an error message." | |
| } | |
| } | |
| } | |
| }, | |
| "/users/lookup/name-zip": { | |
| "get": { | |
| "operationId": "find_user_id_by_name_zip", | |
| "description": "Find user id by first name, last name, and zip code. If the user is not found, the function will return an error message. By default, find user id by email, and only call this function if the user is not found by email or cannot remember email.", | |
| "parameters": [ | |
| { | |
| "name": "first_name", | |
| "in": "query", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The first name of the customer, such as 'John'." | |
| }, | |
| { | |
| "name": "last_name", | |
| "in": "query", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The last name of the customer, such as 'Doe'." | |
| }, | |
| { | |
| "name": "zip", | |
| "in": "query", | |
| "required": true, | |
| "schema": { "type": "string" }, | |
| "description": "The zip code of the customer, such as '12345'." | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Find user id by first name, last name, and zip code. If the user is not found, the function will return an error message. By default, find user id by email, and only call this function if the user is not found by email or cannot remember email." | |
| } | |
| } | |
| } | |
| }, | |
| "/transfer_to_human_agents": { | |
| "post": { | |
| "operationId": "transfer_to_human_agents", | |
| "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { "$ref": "#/components/schemas/transfer_to_human_agents_request" } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools." | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "components": { | |
| "schemas": { | |
| "calculate_request": { | |
| "type": "object", | |
| "properties": { | |
| "expression": { | |
| "type": "string", | |
| "description": "The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces." | |
| } | |
| }, | |
| "required": ["expression"] | |
| }, | |
| "cancel_pending_order_request": { | |
| "type": "object", | |
| "properties": { | |
| "reason": { | |
| "type": "string", | |
| "enum": ["no longer needed", "ordered by mistake"], | |
| "description": "The reason for cancellation, which should be either 'no longer needed' or 'ordered by mistake'." | |
| } | |
| }, | |
| "required": ["reason"] | |
| }, | |
| "exchange_delivered_order_items_request": { | |
| "type": "object", | |
| "properties": { | |
| "item_ids": { | |
| "type": "array", | |
| "items": { "type": "string" }, | |
| "description": "The item ids to be exchanged, each such as '1008292230'. There could be duplicate items in the list." | |
| }, | |
| "new_item_ids": { | |
| "type": "array", | |
| "items": { "type": "string" }, | |
| "description": "The item ids to be exchanged for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product." | |
| }, | |
| "payment_method_id": { | |
| "type": "string", | |
| "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details." | |
| } | |
| }, | |
| "required": ["item_ids", "new_item_ids", "payment_method_id"] | |
| }, | |
| "modify_pending_order_address_request": { | |
| "type": "object", | |
| "properties": { | |
| "address1": { | |
| "type": "string", | |
| "description": "The first line of the address, such as '123 Main St'." | |
| }, | |
| "address2": { | |
| "type": "string", | |
| "description": "The second line of the address, such as 'Apt 1' or ''." | |
| }, | |
| "city": { | |
| "type": "string", | |
| "description": "The city, such as 'San Francisco'." | |
| }, | |
| "state": { | |
| "type": "string", | |
| "description": "The province, such as 'CA'." | |
| }, | |
| "country": { | |
| "type": "string", | |
| "description": "The country, such as 'USA'." | |
| }, | |
| "zip": { | |
| "type": "string", | |
| "description": "The zip code, such as '12345'." | |
| } | |
| }, | |
| "required": ["address1", "address2", "city", "state", "country", "zip"] | |
| }, | |
| "modify_pending_order_items_request": { | |
| "type": "object", | |
| "properties": { | |
| "item_ids": { | |
| "type": "array", | |
| "items": { "type": "string" }, | |
| "description": "The item ids to be modified, each such as '1008292230'. There could be duplicate items in the list." | |
| }, | |
| "new_item_ids": { | |
| "type": "array", | |
| "items": { "type": "string" }, | |
| "description": "The item ids to be modified for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product." | |
| }, | |
| "payment_method_id": { | |
| "type": "string", | |
| "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details." | |
| } | |
| }, | |
| "required": ["item_ids", "new_item_ids", "payment_method_id"] | |
| }, | |
| "modify_pending_order_payment_request": { | |
| "type": "object", | |
| "properties": { | |
| "payment_method_id": { | |
| "type": "string", | |
| "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details." | |
| } | |
| }, | |
| "required": ["payment_method_id"] | |
| }, | |
| "modify_user_address_request": { | |
| "type": "object", | |
| "properties": { | |
| "address1": { | |
| "type": "string", | |
| "description": "The first line of the address, such as '123 Main St'." | |
| }, | |
| "address2": { | |
| "type": "string", | |
| "description": "The second line of the address, such as 'Apt 1' or ''." | |
| }, | |
| "city": { | |
| "type": "string", | |
| "description": "The city, such as 'San Francisco'." | |
| }, | |
| "state": { | |
| "type": "string", | |
| "description": "The province, such as 'CA'." | |
| }, | |
| "country": { | |
| "type": "string", | |
| "description": "The country, such as 'USA'." | |
| }, | |
| "zip": { | |
| "type": "string", | |
| "description": "The zip code, such as '12345'." | |
| } | |
| }, | |
| "required": ["address1", "address2", "city", "state", "country", "zip"] | |
| }, | |
| "return_delivered_order_items_request": { | |
| "type": "object", | |
| "properties": { | |
| "item_ids": { | |
| "type": "array", | |
| "items": { "type": "string" }, | |
| "description": "The item ids to be returned, each such as '1008292230'. There could be duplicate items in the list." | |
| }, | |
| "payment_method_id": { | |
| "type": "string", | |
| "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details." | |
| } | |
| }, | |
| "required": ["item_ids", "payment_method_id"] | |
| }, | |
| "transfer_to_human_agents_request": { | |
| "type": "object", | |
| "properties": { | |
| "summary": { | |
| "type": "string", | |
| "description": "A summary of the user's issue." | |
| } | |
| }, | |
| "required": ["summary"] | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment