274569bd79
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1.7 KiB
C#
39 lines
1.7 KiB
C#
using System.ComponentModel;
|
|
using ModelContextProtocol.Server;
|
|
|
|
namespace MoneyMap.Mcp.Tools;
|
|
|
|
[McpServerToolType]
|
|
public static class BudgetTools
|
|
{
|
|
[McpServerTool(Name = "get_budget_status"), Description("Get all active budgets with current period spending vs. limit.")]
|
|
public static async Task<string> GetBudgetStatus(
|
|
[Description("Date to calculate status for (defaults to today)")] string? asOfDate = null,
|
|
MoneyMapApiClient api = default!)
|
|
{
|
|
return await api.GetBudgetStatusAsync(asOfDate);
|
|
}
|
|
|
|
[McpServerTool(Name = "create_budget"), Description("Create a new budget for a category or total spending.")]
|
|
public static async Task<string> CreateBudget(
|
|
[Description("Budget amount limit")] decimal amount,
|
|
[Description("Period: Weekly, Monthly, or Yearly")] string period,
|
|
[Description("Start date for period calculation, e.g. 2026-01-01")] string startDate,
|
|
[Description("Category name (omit for total spending budget)")] string? category = null,
|
|
MoneyMapApiClient api = default!)
|
|
{
|
|
return await api.CreateBudgetAsync(category, amount, period, startDate);
|
|
}
|
|
|
|
[McpServerTool(Name = "update_budget"), Description("Update an existing budget's amount, period, or active status.")]
|
|
public static async Task<string> UpdateBudget(
|
|
[Description("Budget ID to update")] int budgetId,
|
|
[Description("New budget amount")] decimal? amount = null,
|
|
[Description("New period: Weekly, Monthly, or Yearly")] string? period = null,
|
|
[Description("Set active/inactive")] bool? isActive = null,
|
|
MoneyMapApiClient api = default!)
|
|
{
|
|
return await api.UpdateBudgetAsync(budgetId, amount, period, isActive);
|
|
}
|
|
}
|