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 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 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); } }