2025-04-15 05:25:03 +00:00
|
|
|
using ModelContextProtocol;
|
2025-03-21 05:14:19 +00:00
|
|
|
using ModelContextProtocol.Server;
|
2025-03-19 03:07:31 +00:00
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.PizzaBot.MCPServer.Tools;
|
|
|
|
|
|
2025-03-28 10:13:08 +00:00
|
|
|
[McpServerToolType]
|
2025-03-19 03:07:31 +00:00
|
|
|
public static class MakePayment
|
|
|
|
|
{
|
2025-04-04 02:58:20 +00:00
|
|
|
[McpServerTool(Name = "make_payment"), Description("call this function to make payment.")]
|
2025-03-19 03:07:31 +00:00
|
|
|
public static string Make_Payment(
|
|
|
|
|
[Description("order number"),Required] string order_number,
|
|
|
|
|
[Description("total amount"),Required] int total_amount)
|
|
|
|
|
{
|
|
|
|
|
if (order_number is null)
|
|
|
|
|
{
|
2025-04-15 05:25:03 +00:00
|
|
|
throw new McpException("Missing required argument 'order_number'");
|
2025-03-19 03:07:31 +00:00
|
|
|
}
|
|
|
|
|
if (order_number is null)
|
|
|
|
|
{
|
2025-04-15 05:25:03 +00:00
|
|
|
throw new McpException("Missing required argument 'total_amount'");
|
2025-03-19 03:07:31 +00:00
|
|
|
}
|
|
|
|
|
return "Payment proceed successfully. Thank you for your business. Have a great day!";
|
|
|
|
|
}
|
|
|
|
|
}
|