BotSharp/tests/BotSharp.PizzaBot.MCPServer/Tools/MakePayment.cs

26 lines
866 B
C#
Raw Normal View History

using ModelContextProtocol.Server;
2025-03-19 03:07:31 +00:00
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace BotSharp.PizzaBot.MCPServer.Tools;
[McpServerToolType]
2025-03-19 03:07:31 +00:00
public static class MakePayment
{
[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)
{
throw new McpServerException("Missing required argument 'order_number'");
}
if (order_number is null)
{
throw new McpServerException("Missing required argument 'total_amount'");
}
return "Payment proceed successfully. Thank you for your business. Have a great day!";
}
}