274569bd79
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|