Skip to content

Commit 25b7c8a

Browse files
stephendolanclaude
andauthored
fix(mcp): treat "default" budgetId as fallback to configured default (#36)
MCP clients pass budgetId: "default" as a literal string, which the YNAB API rejects with a 404. Now treated as a signal to use the configured default budget. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b80081d commit 25b7c8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stephendolan/ynab-cli",
3-
"version": "2.8.1",
3+
"version": "2.8.2",
44
"description": "A command-line interface for You Need a Budget (YNAB)",
55
"type": "module",
66
"main": "./dist/cli.js",

src/lib/api-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class YnabClient {
4343
}
4444

4545
async getBudgetId(budgetIdOrDefault?: string): Promise<string> {
46-
const budgetId = budgetIdOrDefault || config.getDefaultBudget() || process.env.YNAB_BUDGET_ID;
46+
const budgetId = (budgetIdOrDefault && budgetIdOrDefault !== 'default' ? budgetIdOrDefault : undefined) || config.getDefaultBudget() || process.env.YNAB_BUDGET_ID;
4747

4848
if (!budgetId) {
4949
throw new YnabCliError(

0 commit comments

Comments
 (0)