Files
MoneyMap/MoneyMap.Mcp/Tools/MerchantTools.cs
T

26 lines
1.1 KiB
C#

using System.ComponentModel;
using ModelContextProtocol.Server;
namespace MoneyMap.Mcp.Tools;
[McpServerToolType]
public static class MerchantTools
{
[McpServerTool(Name = "list_merchants"), Description("List all merchants with transaction counts and category mapping info.")]
public static async Task<string> ListMerchants(
[Description("Filter merchants by name (contains)")] string? query = null,
MoneyMapApiClient api = default!)
{
return await api.ListMerchantsAsync(query);
}
[McpServerTool(Name = "merge_merchants"), Description("Merge duplicate merchants. Reassigns all transactions and category mappings from source to target, then deletes source.")]
public static async Task<string> MergeMerchants(
[Description("Merchant ID to merge FROM (will be deleted)")] int sourceMerchantId,
[Description("Merchant ID to merge INTO (will be kept)")] int targetMerchantId,
MoneyMapApiClient api = default!)
{
return await api.MergeMerchantsAsync(sourceMerchantId, targetMerchantId);
}
}