get_budget_settings
Retrieve budget period and display settings including granularity, period length, anchor date, and preferences for hiding no-activity, income, and rollover left to budget.
Instructions
Get budget period and display settings for the account (granularity, period length, anchor date, hide-no-activity preference, income option, rollover-left-to-budget setting).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/budgets.ts:127-143 (handler)The async handler function for get_budget_settings. It calls the Lunchmoney API GET /budgets/settings endpoint, handles errors, and returns the response data.
async () => { try { const response = await api.get("/budgets/settings"); if (!response.ok) { return handleApiError( response, "Failed to get budget settings", ); } return dataResponse(await response.json()); } catch (error) { return catchError(error, "Failed to get budget settings"); } }, ); - src/tools/budgets.ts:119-126 (schema)The tool registration with description and readOnlyHint annotation. No input schema is defined since this tool takes no parameters.
"get_budget_settings", { description: "Get budget period and display settings for the account (granularity, period length, anchor date, hide-no-activity preference, income option, rollover-left-to-budget setting).", annotations: { readOnlyHint: true, }, }, - src/tools/budgets.ts:118-143 (registration)Registration of the 'get_budget_settings' tool via server.registerTool() inside registerBudgetTools(). The tool is exported from src/index.ts on line 30.
server.registerTool( "get_budget_settings", { description: "Get budget period and display settings for the account (granularity, period length, anchor date, hide-no-activity preference, income option, rollover-left-to-budget setting).", annotations: { readOnlyHint: true, }, }, async () => { try { const response = await api.get("/budgets/settings"); if (!response.ok) { return handleApiError( response, "Failed to get budget settings", ); } return dataResponse(await response.json()); } catch (error) { return catchError(error, "Failed to get budget settings"); } }, ); - src/api.ts:146-153 (helper)The 'api' object with the 'get' method used by the handler to make the HTTP GET request.
export const api = { get: (path: string) => apiRequest("GET", path), post: (path: string, body?: unknown) => apiRequest("POST", path, body), put: (path: string, body: unknown) => apiRequest("PUT", path, body), delete: (path: string, body?: unknown) => apiRequest("DELETE", path, body), upload: (path: string, formData: FormData) => apiUpload("POST", path, formData), }; - src/types.ts:274-287 (helper)The BudgetSettings TypeScript interface defining the shape of the response from the /budgets/settings endpoint.
export interface BudgetSettings { budget_period_granularity: | "day" | "week" | "month" | "year" | "twice a month"; budget_period_quantity: number; budget_period_anchor_date: string; budget_hide_no_activity: boolean; budget_use_last_day_of_month: boolean; budget_income_option: "max" | "budgeted" | "activity"; budget_rollover_left_to_budget: boolean; }