@dizzlkheinz/ynab-mcpb 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.code/agents/0098661e-0fa3-4990-beb9-c0cbf3f123aa/status.txt +1 -0
  2. package/.code/agents/1324/exec-call_tIpx9uV1TpARbAMZonRQm8AO.txt +757 -0
  3. package/.code/agents/1572/exec-call_GjVFBFOWcY7lE0idc5nWlLNh.txt +781 -0
  4. package/.code/agents/1846/exec-call_1YNAVD18RjrMN7JnfkkQhUP3.txt +766 -0
  5. package/.code/agents/1846/exec-call_lh3lDzE4WJAh1lFiomiiZ73D.txt +766 -0
  6. package/.code/agents/2038/exec-call_DYwOukaYsL8VCONWmV2rUW5u.txt +766 -0
  7. package/.code/agents/2038/exec-call_c7fOQ7UrpVcTtvdfGBRM146V.txt +652 -0
  8. package/.code/agents/2038/exec-call_ySNyq9Mm55jWE480s54r5QcA.txt +766 -0
  9. package/.code/agents/2256/exec-call_AtPcRWPmFPMcmX6qOFm1fCEY.txt +766 -0
  10. package/.code/agents/2454/exec-call_aFJpupwjfZeOBm7ixI5Vc8z2.txt +766 -0
  11. package/.code/agents/2454/exec-call_wogZ4HfXTodTEXvdgXlVUBpv.txt +766 -0
  12. package/.code/agents/2e905864-aa07-4314-bcf9-c5b32277e4ac/result.txt +36 -0
  13. package/.code/agents/3073/exec-call_Peeagc9DxGYLgE6pNdMZhqIE.txt +766 -0
  14. package/.code/agents/3073/exec-call_d2YSE3hXF08KRSoUM3qd8Z3x.txt +766 -0
  15. package/.code/agents/335aa031-466d-4fb7-925f-3cd864e264d0/result.txt +191 -0
  16. package/.code/agents/3364/exec-call_NbhIrsM5HhyDZDmJZG5CuCYL.txt +766 -0
  17. package/.code/agents/3364/exec-call_cKtJg0NrXiwXEFwlsE3uPZRA.txt +766 -0
  18. package/.code/agents/36d98414-5cde-4d9d-9a67-a240a18c1f07/result.txt +189 -0
  19. package/.code/agents/4604e866-b7b8-44f5-992f-2f683b0a523b/status.txt +1 -0
  20. package/.code/agents/5f8dc01c-47b3-4163-b0b3-aa31be89fcdc/status.txt +1 -0
  21. package/.code/agents/7/exec-call_HltHpkDox0Zm1vGEjdksUgpE.txt +1120 -0
  22. package/.code/agents/7/exec-call_LCATrOPPAgbxW9Q1z0XaVi2E.txt +2646 -0
  23. package/.code/agents/7/exec-call_W8DeRfNG9hvbgVFvf0clBf6R.txt +2646 -0
  24. package/.code/agents/94a0ddf3-a304-4ec3-913e-3cceef509948/error.txt +1 -0
  25. package/.code/agents/e2c752b7-711d-423a-af57-f53c809deb84/result.txt +160 -0
  26. package/.code/agents/e6601719-c31f-4a0e-8c71-d70787d0ab71/status.txt +1 -0
  27. package/.code/agents/f250b7ed-5bd5-4036-aa8c-ce63caee7d61/result.txt +20 -0
  28. package/AGENTS.md +1 -36
  29. package/CLAUDE.md +28 -43
  30. package/NUL +0 -1
  31. package/README.md +8 -10
  32. package/dist/bundle/index.cjs +41 -41
  33. package/dist/server/YNABMCPServer.js +28 -381
  34. package/dist/server/config.d.ts +2 -0
  35. package/dist/server/config.js +1 -0
  36. package/dist/tools/accountTools.d.ts +2 -0
  37. package/dist/tools/accountTools.js +45 -0
  38. package/dist/tools/adapters.d.ts +12 -0
  39. package/dist/tools/adapters.js +25 -0
  40. package/dist/tools/budgetTools.d.ts +2 -0
  41. package/dist/tools/budgetTools.js +30 -0
  42. package/dist/tools/categoryTools.d.ts +2 -0
  43. package/dist/tools/categoryTools.js +45 -0
  44. package/dist/tools/monthTools.d.ts +2 -0
  45. package/dist/tools/monthTools.js +32 -0
  46. package/dist/tools/payeeTools.d.ts +2 -0
  47. package/dist/tools/payeeTools.js +32 -0
  48. package/dist/tools/reconciliation/index.d.ts +2 -0
  49. package/dist/tools/reconciliation/index.js +33 -0
  50. package/dist/tools/schemas/common.d.ts +3 -0
  51. package/dist/tools/schemas/common.js +3 -0
  52. package/dist/tools/schemas/outputs/comparisonOutputs.d.ts +1 -1
  53. package/dist/tools/transactionTools.d.ts +2 -0
  54. package/dist/tools/transactionTools.js +124 -0
  55. package/dist/tools/utilityTools.d.ts +3 -1
  56. package/dist/tools/utilityTools.js +32 -2
  57. package/dist/types/index.d.ts +1 -0
  58. package/dist/types/toolRegistration.d.ts +27 -0
  59. package/dist/types/toolRegistration.js +1 -0
  60. package/package.json +2 -2
  61. package/scripts/run-domain-integration-tests.js +4 -1
  62. package/src/__tests__/workflows.e2e.test.ts +1 -7
  63. package/src/server/YNABMCPServer.ts +33 -519
  64. package/src/server/__tests__/toolRegistration.test.ts +236 -0
  65. package/src/server/config.ts +1 -0
  66. package/src/tools/__tests__/adapters.test.ts +113 -0
  67. package/src/tools/__tests__/utilityTools.test.ts +7 -7
  68. package/src/tools/accountTools.ts +53 -0
  69. package/src/tools/adapters.ts +74 -0
  70. package/src/tools/budgetTools.ts +37 -0
  71. package/src/tools/categoryTools.ts +53 -0
  72. package/src/tools/monthTools.ts +39 -0
  73. package/src/tools/payeeTools.ts +39 -0
  74. package/src/tools/reconciliation/index.ts +45 -0
  75. package/src/tools/schemas/common.ts +18 -0
  76. package/src/tools/transactionTools.ts +140 -0
  77. package/src/tools/utilityTools.ts +42 -2
  78. package/src/types/index.ts +3 -0
  79. package/src/types/toolRegistration.ts +88 -0
  80. package/.github/workflows/pr-description-check.yml +0 -88
  81. package/docs/README.md +0 -72
  82. package/docs/getting-started/CONFIGURATION.md +0 -175
  83. package/docs/getting-started/INSTALLATION.md +0 -333
  84. package/docs/getting-started/QUICKSTART.md +0 -282
  85. package/docs/guides/ARCHITECTURE.md +0 -533
  86. package/docs/guides/DEPLOYMENT.md +0 -189
  87. package/docs/guides/INTEGRATION_TESTING.md +0 -730
  88. package/docs/guides/TESTING.md +0 -591
  89. package/docs/reconciliation-flow.md +0 -83
  90. package/docs/reference/EXAMPLES.md +0 -946
  91. package/docs/reference/TOOLS.md +0 -348
  92. package/docs/reference/TROUBLESHOOTING.md +0 -481
@@ -1,481 +0,0 @@
1
- # YNAB MCP Server Troubleshooting Guide
2
-
3
- Common issues, solutions, and debugging techniques for the YNAB MCP Server.
4
-
5
- ## Table of Contents
6
-
7
- - [Common Issues](#common-issues)
8
- - [Error Messages](#error-messages)
9
- - [Connection Problems](#connection-problems)
10
- - [Performance Issues](#performance-issues)
11
- - [Data Issues](#data-issues)
12
- - [Debug Techniques](#debug-techniques)
13
-
14
- ## Common Issues
15
-
16
- ### 1. Invalid or Expired YNAB Access Token
17
-
18
- **Symptoms**: 401 authentication errors, "Invalid or expired token" messages
19
-
20
- **Solutions**:
21
- - Check if `YNAB_ACCESS_TOKEN` environment variable is set
22
- - Verify token in YNAB Developer Settings
23
- - Generate new token if expired
24
- - Ensure token has no extra spaces or characters
25
- - For Claude Desktop: Check extension settings for correct token configuration
26
-
27
- **How to generate a new token**:
28
- 1. Log in to [YNAB Web App](https://app.youneedabudget.com)
29
- 2. Go to Account Settings → Developer Settings
30
- 3. Click "New Token"
31
- 4. Provide a descriptive name (e.g., "MCP Server")
32
- 5. Copy the generated token immediately (it's only shown once)
33
- 6. Add it to your `.env` file or Claude Desktop extension settings
34
-
35
- ### 2. Rate Limit Exceeded
36
-
37
- **Symptoms**: 429 errors, especially during bulk operations
38
-
39
- **Solutions**:
40
- - Implement retry logic with exponential backoff
41
- - Add delays between API calls
42
- - Use batch processing with smaller batch sizes
43
- - Leverage caching to reduce API calls
44
- - The v0.8.x enhanced caching helps prevent rate limit issues
45
-
46
- **Example retry logic**:
47
- ```javascript
48
- async function withRetry(operation, maxRetries = 3, baseDelay = 1000) {
49
- for (let attempt = 1; attempt <= maxRetries; attempt++) {
50
- try {
51
- return await operation();
52
- } catch (error) {
53
- if (attempt === maxRetries) throw error;
54
- const delay = baseDelay * Math.pow(2, attempt - 1);
55
- await new Promise(resolve => setTimeout(resolve, delay));
56
- }
57
- }
58
- }
59
- ```
60
-
61
- ### 3. Resource Not Found
62
-
63
- **Symptoms**: 404 errors when accessing budgets, accounts, or transactions
64
-
65
- **Solutions**:
66
- - Verify IDs are correct and current
67
- - Check if resources have been deleted in YNAB
68
- - Use list operations to discover valid IDs
69
- - Handle deleted/hidden items in your code
70
- - Ensure you're using the correct budget context
71
-
72
- **Example ID verification**:
73
- ```javascript
74
- // Always verify IDs exist before operations
75
- const accounts = await client.callTool('list_accounts', { budget_id: budgetId });
76
- const accountIds = accounts.accounts.map(a => a.id);
77
- if (!accountIds.includes(targetAccountId)) {
78
- throw new Error(`Account ${targetAccountId} not found`);
79
- }
80
- ```
81
-
82
- ### 4. Incorrect Transaction Amounts
83
-
84
- **Symptoms**: Transactions appear with wrong amounts (off by factor of 1000)
85
-
86
- **Solutions**:
87
- - Always convert dollars to milliunits before API calls (multiply by 1000)
88
- - Use the `convert_amount` tool for accuracy
89
- - Remember negative amounts for outflows
90
- - Consider account types (credit cards need negative amounts for payments)
91
-
92
- **Conversion reference**:
93
- ```
94
- $25.50 → 25500 milliunits
95
- -$100.00 → -100000 milliunits
96
- ```
97
-
98
- ### 5. Date-Related Errors
99
-
100
- **Symptoms**: Validation errors or unexpected behavior with dates
101
-
102
- **Solutions**:
103
- - Use ISO format (YYYY-MM-DD) for all dates
104
- - Validate date format before API calls
105
- - Consider timezone differences
106
- - Use first day of month (YYYY-MM-01) for monthly operations
107
-
108
- **Valid date formats**:
109
- ```javascript
110
- // ✅ Correct
111
- '2024-01-15'
112
- '2024-12-31'
113
-
114
- // ❌ Wrong
115
- '01/15/2024' // US format
116
- '15-01-2024' // European format
117
- '2024-1-15' // Missing zero padding
118
- ```
119
-
120
- ## Error Messages
121
-
122
- ### AUTHENTICATION_ERROR
123
-
124
- **Meaning**: YNAB access token is invalid or expired
125
-
126
- **Solution**: Generate a new token and update configuration
127
-
128
- ### AUTHORIZATION_ERROR
129
-
130
- **Meaning**: Token doesn't have permission for requested operation
131
-
132
- **Solution**: Verify token scope and permissions in YNAB settings
133
-
134
- ### VALIDATION_ERROR
135
-
136
- **Meaning**: Input parameters are invalid or missing
137
-
138
- **Solution**: Check parameter format, types, and required fields
139
-
140
- ### RATE_LIMIT_EXCEEDED
141
-
142
- **Meaning**: Too many requests to YNAB API
143
-
144
- **Solution**: Implement retry logic, add delays, use caching
145
-
146
- ### RESOURCE_NOT_FOUND
147
-
148
- **Meaning**: Requested budget, account, or transaction doesn't exist
149
-
150
- **Solution**: Verify IDs, check for deleted items, use list operations
151
-
152
- ### OPERATION_FAILED
153
-
154
- **Meaning**: Generic operation failure
155
-
156
- **Solution**: Check error details, verify data validity, check YNAB API status
157
-
158
- ## Connection Problems
159
-
160
- ### Server Won't Start
161
-
162
- **Symptoms**: Server fails to start, immediate crash
163
-
164
- **Diagnostics**:
165
- ```bash
166
- # Check Node.js version (must be 18+)
167
- node --version
168
-
169
- # Verify build completed
170
- ls dist/index.js
171
-
172
- # Check for syntax errors
173
- npm run type-check
174
-
175
- # View detailed error logs
176
- npm start 2>&1 | tee server.log
177
- ```
178
-
179
- **Solutions**:
180
- - Ensure Node.js 18+ is installed
181
- - Run `npm install` to install dependencies
182
- - Run `npm run build` to compile TypeScript
183
- - Check environment variables are set correctly
184
-
185
- ### Claude Desktop Can't Connect
186
-
187
- **Symptoms**: Server shows as disconnected in Claude Desktop
188
-
189
- **Diagnostics**:
190
- 1. Check Claude Desktop logs for error messages
191
- 2. Verify MCP server configuration in settings
192
- 3. Confirm working directory path is correct
193
- 4. Check that `dist/index.js` exists
194
-
195
- **Solutions**:
196
- - Verify server configuration in Claude Desktop settings:
197
- - Command: `node`
198
- - Arguments: `["dist/index.js"]`
199
- - Working Directory: correct absolute path
200
- - Restart Claude Desktop completely
201
- - Check file permissions on dist directory
202
- - Verify YNAB_ACCESS_TOKEN is set in extension settings
203
-
204
- ### Intermittent Connection Drops
205
-
206
- **Symptoms**: Server disconnects randomly, reconnects after delay
207
-
208
- **Diagnostics**:
209
- ```javascript
210
- // Check diagnostic info for system health
211
- const result = await client.callTool('diagnostic_info');
212
- const diagnostics = JSON.parse(result.content[0].text);
213
- console.log('Server Health:', diagnostics.diagnostics.server_info);
214
- ```
215
-
216
- **Solutions**:
217
- - Check system resource usage (CPU, memory)
218
- - Review cache configuration (may need to reduce cache size)
219
- - Check for network connectivity issues
220
- - Update to latest version
221
-
222
- ## Performance Issues
223
-
224
- ### Slow Response Times
225
-
226
- **Symptoms**: Requests take longer than expected (>5 seconds)
227
-
228
- **Diagnostics**:
229
- ```javascript
230
- // Check cache performance
231
- const result = await client.callTool('diagnostic_info');
232
- const stats = JSON.parse(result.content[0].text).diagnostics.cache_stats;
233
- console.log('Cache Hit Rate:', stats.hit_rate); // Should be >60%
234
- ```
235
-
236
- **Solutions**:
237
- - Verify cache warming is enabled (v0.8.x)
238
- - Check cache hit rate (should be 60-80% after warmup)
239
- - Increase cache TTL for static data
240
- - Use cache warming by setting default budget
241
- - Check network latency to YNAB API
242
-
243
- **Expected performance**:
244
- - Cached requests: <1 second
245
- - Fresh API requests: 1-5 seconds
246
- - Large data sets: 5-10 seconds
247
-
248
- ### High Memory Usage
249
-
250
- **Symptoms**: Memory usage grows over time, eventual crashes
251
-
252
- **Diagnostics**:
253
- ```javascript
254
- // Check memory usage
255
- const result = await client.callTool('diagnostic_info');
256
- const memory = JSON.parse(result.content[0].text).diagnostics.server_info.memory_usage;
257
- console.log('Memory:', memory);
258
- ```
259
-
260
- **Solutions**:
261
- - Check cache size limits (default: 1000 entries)
262
- - Reduce `YNAB_MCP_CACHE_MAX_ENTRIES` if needed
263
- - Verify LRU eviction is working
264
- - Restart server periodically for long-running instances
265
- - Check for memory leaks (monitor over time)
266
-
267
- **Healthy memory usage**:
268
- - Baseline: 50-100MB
269
- - Under load: 100-200MB
270
- - Max acceptable: <500MB
271
-
272
- ### Cache Not Working
273
-
274
- **Symptoms**: Every request hits YNAB API, no performance improvement
275
-
276
- **Diagnostics**:
277
- ```javascript
278
- // Verify cache stats
279
- const stats = cacheManager.getStats();
280
- console.log('Cache Stats:', {
281
- hitRate: stats.hit_rate,
282
- totalHits: stats.total_hits,
283
- totalMisses: stats.total_misses
284
- });
285
- ```
286
-
287
- **Solutions**:
288
- - Verify cache is enabled (check environment variables)
289
- - Ensure consistent cache keys are used
290
- - Check TTL configuration isn't too short
291
- - Verify cache warming triggered (use `set_default_budget`)
292
- - Check cache isn't being cleared unintentionally
293
-
294
- ## Data Issues
295
-
296
- ### Missing Transactions
297
-
298
- **Symptoms**: Transactions exist in YNAB but don't appear in results
299
-
300
- **Solutions**:
301
- - Check date filters (transactions may be outside range)
302
- - Verify account/category filters
303
- - Check for hidden/deleted transactions
304
- - Clear cache and retry
305
- - Verify budget context is correct
306
-
307
- ### Incorrect Balances
308
-
309
- **Symptoms**: Account or category balances don't match YNAB
310
-
311
- **Solutions**:
312
- - Clear cache to get fresh data
313
- - Verify all transactions are included
314
- - Check for pending/uncleared transactions
315
- - Ensure milliunits conversion is correct
316
- - Verify reconciliation status
317
-
318
- ### Duplicate Transactions
319
-
320
- **Symptoms**: Same transaction appears multiple times
321
-
322
- **Solutions**:
323
- - Use transaction IDs to deduplicate
324
- - Check import detection settings
325
- - Verify transaction matching logic
326
- - Use the `compare_transactions` tool for CSV imports
327
- - Review reconciliation recommendations
328
-
329
- ## Debug Techniques
330
-
331
- ### Enable Detailed Logging
332
-
333
- ```bash
334
- # Set environment variable for debug logging
335
- LOG_LEVEL=debug npm start
336
-
337
- # Or in .env file
338
- LOG_LEVEL=debug
339
- ```
340
-
341
- ### Use Diagnostic Info Tool
342
-
343
- ```javascript
344
- // Get comprehensive server diagnostics
345
- async function runDiagnostics() {
346
- const result = await client.callTool('diagnostic_info');
347
- const diagnostics = JSON.parse(result.content[0].text);
348
-
349
- console.log('Server Info:', diagnostics.diagnostics.server_info);
350
- console.log('Environment:', diagnostics.diagnostics.environment);
351
- console.log('Cache Stats:', diagnostics.diagnostics.cache_stats);
352
- console.log('Security Stats:', diagnostics.diagnostics.security_stats);
353
-
354
- return diagnostics;
355
- }
356
- ```
357
-
358
- ### Log API Calls
359
-
360
- ```javascript
361
- class DebugLogger {
362
- static logAPICall(toolName, params, result) {
363
- console.log(`[API] ${toolName}:`, {
364
- params: this.sanitizeParams(params),
365
- resultSize: JSON.stringify(result).length,
366
- timestamp: new Date().toISOString()
367
- });
368
- }
369
-
370
- static sanitizeParams(params) {
371
- // Remove sensitive data from logs
372
- const sanitized = { ...params };
373
- if (sanitized.budget_id) {
374
- sanitized.budget_id = sanitized.budget_id.substring(0, 8) + '...';
375
- }
376
- return sanitized;
377
- }
378
-
379
- static logError(error, context) {
380
- console.error(`[ERROR] ${context}:`, {
381
- message: error.message,
382
- code: error.code,
383
- timestamp: new Date().toISOString()
384
- });
385
- }
386
- }
387
-
388
- // Usage in your code
389
- const result = await client.callTool('list_budgets', {});
390
- DebugLogger.logAPICall('list_budgets', {}, result);
391
- ```
392
-
393
- ### Monitor Cache Performance
394
-
395
- ```javascript
396
- // Periodically log cache performance
397
- setInterval(async () => {
398
- const result = await client.callTool('diagnostic_info');
399
- const stats = JSON.parse(result.content[0].text).diagnostics.cache_stats;
400
-
401
- console.log('Cache Performance:', {
402
- hitRate: stats.hit_rate.toFixed(2),
403
- entries: stats.total_entries,
404
- hits: stats.total_hits,
405
- misses: stats.total_misses
406
- });
407
- }, 60000); // Every minute
408
- ```
409
-
410
- ### Test Specific Scenarios
411
-
412
- ```javascript
413
- // Create a test suite for specific issues
414
- async function testScenario() {
415
- console.log('Testing budget access...');
416
- const budgets = await client.callTool('list_budgets', {});
417
- console.log('✓ Budgets retrieved');
418
-
419
- console.log('Testing account access...');
420
- const accounts = await client.callTool('list_accounts', {
421
- budget_id: budgets.budgets[0].id
422
- });
423
- console.log('✓ Accounts retrieved');
424
-
425
- console.log('Testing transaction access...');
426
- const transactions = await client.callTool('list_transactions', {
427
- budget_id: budgets.budgets[0].id
428
- });
429
- console.log('✓ Transactions retrieved');
430
-
431
- console.log('All tests passed!');
432
- }
433
- ```
434
-
435
- ### Compare with YNAB Web App
436
-
437
- When data discrepancies occur:
438
-
439
- 1. **Check same data in YNAB web app**
440
- 2. **Compare IDs, amounts, dates**
441
- 3. **Verify account/budget context matches**
442
- 4. **Check for timezone differences**
443
- 5. **Clear cache and retry**
444
-
445
- ### Check YNAB API Status
446
-
447
- If experiencing widespread issues:
448
-
449
- 1. Visit [YNAB API Status](https://status.youneedabudget.com/)
450
- 2. Check for reported incidents
451
- 3. Verify API availability
452
- 4. Check for maintenance windows
453
-
454
- ## Getting Additional Help
455
-
456
- If issues persist:
457
-
458
- 1. **Check Documentation**:
459
- - [API Reference](API.md)
460
- - [Development Guide](../guides/DEVELOPMENT.md)
461
- - [Architecture Guide](../guides/ARCHITECTURE.md)
462
-
463
- 2. **Review Logs**:
464
- - Claude Desktop logs
465
- - Server console output
466
- - Diagnostic info output
467
-
468
- 3. **Report Issues**:
469
- - GitHub Issues for bug reports
470
- - Include: version, error messages, steps to reproduce
471
- - Provide diagnostic info (sanitize sensitive data)
472
-
473
- 4. **Community Resources**:
474
- - YNAB API Documentation
475
- - MCP Protocol Documentation
476
- - Project GitHub Discussions
477
-
478
- ---
479
-
480
- For development patterns and best practices, see [`../guides/DEVELOPMENT.md`](../guides/DEVELOPMENT.md).
481
- For testing strategies, see [`../guides/TESTING.md`](../guides/TESTING.md).