@dizzlkheinz/ynab-mcpb 0.16.0 → 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 (114) 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 +131 -51
  30. package/NUL +0 -1
  31. package/README.md +27 -14
  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 +129 -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__/transactionTools.test.ts +90 -17
  68. package/src/tools/__tests__/utilityTools.test.ts +7 -7
  69. package/src/tools/accountTools.ts +53 -0
  70. package/src/tools/adapters.ts +74 -0
  71. package/src/tools/budgetTools.ts +37 -0
  72. package/src/tools/categoryTools.ts +53 -0
  73. package/src/tools/monthTools.ts +39 -0
  74. package/src/tools/payeeTools.ts +39 -0
  75. package/src/tools/reconciliation/index.ts +45 -0
  76. package/src/tools/schemas/common.ts +18 -0
  77. package/src/tools/transactionTools.ts +150 -0
  78. package/src/tools/utilityTools.ts +42 -2
  79. package/src/types/index.ts +3 -0
  80. package/src/types/toolRegistration.ts +88 -0
  81. package/.dxtignore +0 -57
  82. package/.github/workflows/pr-description-check.yml +0 -88
  83. package/CODEREVIEW_RESPONSE.md +0 -128
  84. package/SCHEMA_IMPROVEMENT_SUMMARY.md +0 -120
  85. package/TESTING_NOTES.md +0 -217
  86. package/accountactivity-merged.csv +0 -149
  87. package/bundle-analysis.html +0 -13110
  88. package/docs/README.md +0 -72
  89. package/docs/getting-started/CONFIGURATION.md +0 -175
  90. package/docs/getting-started/INSTALLATION.md +0 -333
  91. package/docs/getting-started/QUICKSTART.md +0 -282
  92. package/docs/guides/ARCHITECTURE.md +0 -533
  93. package/docs/guides/DEPLOYMENT.md +0 -189
  94. package/docs/guides/INTEGRATION_TESTING.md +0 -730
  95. package/docs/guides/TESTING.md +0 -591
  96. package/docs/plans/2025-11-20-reloadable-config-token-validation.md +0 -93
  97. package/docs/plans/2025-11-21-fix-transaction-cached-property.md +0 -362
  98. package/docs/plans/2025-11-21-reconciliation-error-handling.md +0 -90
  99. package/docs/plans/2025-11-21-v014-hardening.md +0 -153
  100. package/docs/plans/reconciliation-v2-redesign.md +0 -1571
  101. package/docs/reconciliation-flow.md +0 -83
  102. package/docs/reference/EXAMPLES.md +0 -946
  103. package/docs/reference/TOOLS.md +0 -348
  104. package/docs/reference/TROUBLESHOOTING.md +0 -481
  105. package/fix-types.sh +0 -17
  106. package/test-csv-sample.csv +0 -28
  107. package/test-exports/sample_bank_statement.csv +0 -7
  108. package/test-reconcile-autodetect.js +0 -40
  109. package/test-reconcile-tool.js +0 -152
  110. package/test-reconcile-with-csv.cjs +0 -89
  111. package/test-statement.csv +0 -8
  112. package/test_debug.js +0 -47
  113. package/test_mcp_tools.mjs +0 -75
  114. package/test_simple.mjs +0 -16
@@ -1,348 +0,0 @@
1
- # YNAB MCP Server - Tools Quick Reference
2
-
3
- Quick reference guide for all available tools. For detailed documentation, see the [complete API Reference](API.md).
4
-
5
- ## Tool Categories
6
-
7
- - [Budget Management](#budget-management) (4 tools)
8
- - [Account Management](#account-management) (3 tools)
9
- - [Transaction Management](#transaction-management) (11 tools)
10
- - [Category Management](#category-management) (3 tools)
11
- - [Payee Management](#payee-management) (2 tools)
12
- - [Monthly Data](#monthly-data) (2 tools)
13
- - [Utilities](#utilities) (2 tools)
14
- - [Diagnostics](#diagnostics) (3 tools)
15
-
16
- **Total: 30 tools**
17
-
18
- ## Structured Output Support
19
-
20
- All 30 tools now include **Zod-based output schemas** for type-safe response validation, improving AI model parsing and integration reliability. Output schemas are automatically validated by the tool registry before returning responses to clients.
21
-
22
- ### Output Schema Benefits
23
-
24
- 1. **Type-safe responses** - TypeScript type inference with `z.infer<typeof Schema>`
25
- 2. **Runtime validation** - Prevents malformed data from reaching clients
26
- 3. **Self-documenting API** - Schema definitions serve as contracts for tool outputs
27
- 4. **Improved AI parsing** - Structured data helps AI models understand responses
28
-
29
- ### Usage Example
30
-
31
- ```typescript
32
- import { ListBudgetsOutputSchema } from './src/tools/schemas/outputs/index.js';
33
-
34
- // Type inference from schema
35
- type ListBudgetsOutput = z.infer<typeof ListBudgetsOutputSchema>;
36
-
37
- // Runtime validation
38
- const result = await callTool('list_budgets', {});
39
- const validation = ListBudgetsOutputSchema.safeParse(result);
40
-
41
- if (validation.success) {
42
- // Validated data with type safety
43
- const budgets = validation.data.budgets;
44
- const cached = validation.data.cached;
45
- } else {
46
- // Handle validation errors
47
- console.error('Schema validation failed:', validation.error);
48
- }
49
- ```
50
-
51
- ### Schema Organization
52
-
53
- Output schemas are organized by tool domain in `src/tools/schemas/outputs/`:
54
-
55
- - `budgetOutputs.ts` - Budget management tool outputs
56
- - `accountOutputs.ts` - Account management tool outputs
57
- - `transactionOutputs.ts` - Transaction tool outputs
58
- - `categoryOutputs.ts` - Category tool outputs
59
- - `payeeOutputs.ts` - Payee tool outputs
60
- - `monthOutputs.ts` - Monthly data tool outputs
61
- - `utilityOutputs.ts` - Utility tool outputs
62
- - `transactionMutationOutputs.ts` - Transaction creation/update outputs
63
- - `reconciliationOutputs.ts` - Account reconciliation outputs
64
- - `comparisonOutputs.ts` - Transaction comparison and export outputs
65
-
66
- All schemas are centrally exported from `src/tools/schemas/outputs/index.ts`.
67
-
68
- ### Automatic Validation
69
-
70
- The tool registry (lines 401-483 in `src/server/toolRegistry.ts`) automatically validates handler responses against declared schemas. Validation errors are returned as standard error responses, ensuring clients always receive schema-compliant data or clear error messages.
71
-
72
- **Note**: Output schemas are optional but recommended. Tools without schemas will continue to work as before, but won't benefit from automatic validation and type safety.
73
-
74
- ---
75
-
76
- ## Budget Management
77
-
78
- | Tool | Purpose | Key Parameters |
79
- |------|---------|----------------|
80
- | `list_budgets` | List all budgets | None |
81
- | `get_budget` | Get budget details | `budget_id` |
82
- | `set_default_budget` | Set default budget | `budget_id` |
83
- | `get_default_budget` | Get current default | None |
84
-
85
- **Common Use**: Always call `set_default_budget` first to enable automatic budget resolution in other tools.
86
-
87
- ---
88
-
89
- ## Account Management
90
-
91
- | Tool | Purpose | Key Parameters |
92
- |------|---------|----------------|
93
- | `list_accounts` | List all accounts | `budget_id`* |
94
- | `get_account` | Get account details | `budget_id`*, `account_id` |
95
- | `create_account` | Create new account | `budget_id`*, `name`, `type`, `balance`? |
96
-
97
- **Account Types**: `checking`, `savings`, `creditCard`, `cash`, `lineOfCredit`, `otherAsset`, `otherLiability`
98
-
99
- ---
100
-
101
- ## Transaction Management
102
-
103
- | Tool | Purpose | Key Parameters |
104
- |------|---------|----------------|
105
- | `list_transactions` | List transactions | `budget_id`*, `account_id`?, `since_date`? |
106
- | `export_transactions` | Export to JSON file | `budget_id`*, `account_id`?, `since_date`? |
107
- | `compare_transactions` | Compare CSV with YNAB | `budget_id`*, `csv_content`, `account_id`? |
108
- | `reconcile_account` | Reconcile with CSV | `budget_id`*, `account_id`, `csv_content`, `statement_balance`? |
109
- | `get_transaction` | Get transaction details | `budget_id`*, `transaction_id` |
110
- | `create_transaction` | Create transaction | `budget_id`*, `account_id`, `amount`, `date`, ... |
111
- | `create_receipt_split_transaction` | Create split from receipt | `budget_id`*, `account_id`, `receipt_items`, `tax`, ... |
112
- | `update_transaction` | Update transaction | `budget_id`*, `transaction_id`, ... |
113
- | `delete_transaction` | Delete transaction | `budget_id`*, `transaction_id` |
114
-
115
- **Note**: Amounts are in milliunits for create/update operations (1 dollar = 1000 milliunits)
116
-
117
- ---
118
-
119
- ## Category Management
120
-
121
- | Tool | Purpose | Key Parameters |
122
- |------|---------|----------------|
123
- | `list_categories` | List all categories | `budget_id`* |
124
- | `get_category` | Get category details | `budget_id`*, `category_id` |
125
- | `update_category` | Update category budget | `budget_id`*, `month`, `category_id`, `budgeted` |
126
-
127
- **Note**: Categories are organized in category groups. Use `list_categories` to see the hierarchy.
128
-
129
- ---
130
-
131
- ## Payee Management
132
-
133
- | Tool | Purpose | Key Parameters |
134
- |------|---------|----------------|
135
- | `list_payees` | List all payees | `budget_id`* |
136
- | `get_payee` | Get payee details | `budget_id`*, `payee_id` |
137
-
138
- ---
139
-
140
- ## Monthly Data
141
-
142
- | Tool | Purpose | Key Parameters |
143
- |------|---------|----------------|
144
- | `get_month` | Get monthly budget data | `budget_id`*, `month` |
145
- | `list_months` | List all months summary | `budget_id`* |
146
-
147
- **Month Format**: `YYYY-MM-01` (always use first day of month)
148
-
149
- ---
150
-
151
- ## Utilities
152
-
153
- | Tool | Purpose | Key Parameters |
154
- |------|---------|----------------|
155
- | `get_user` | Get user information | None |
156
- | `convert_amount` | Convert dollars ↔ milliunits | `amount`, `to_milliunits` |
157
-
158
- **Conversion**:
159
- - Dollars to milliunits: `multiply by 1000`
160
- - Milliunits to dollars: `divide by 1000`
161
-
162
- ---
163
-
164
- ## Diagnostics
165
-
166
- | Tool | Purpose | Key Parameters |
167
- |------|---------|----------------|
168
- | `diagnostic_info` | Get system diagnostics | None |
169
- | `clear_cache` | Clear the cache | None |
170
- | `set_output_format` | Configure output format | `minify`, `spaces`? |
171
-
172
- **Diagnostic Info Includes**:
173
- - Server version and uptime
174
- - Cache statistics (hit rate, entries)
175
- - Memory usage
176
- - Environment configuration
177
- - Authentication status
178
-
179
- ---
180
-
181
- ## Parameter Conventions
182
-
183
- ### Required vs Optional
184
-
185
- - **Required parameters**: Must be provided
186
- - **Optional parameters**: Marked with `?` can be omitted
187
- - **Auto-resolved parameters**: Marked with `*` are auto-filled if default budget is set
188
-
189
- ### Common Parameters
190
-
191
- | Parameter | Type | Description |
192
- |-----------|------|-------------|
193
- | `budget_id` | string | Budget ID (auto-resolved if default set) |
194
- | `account_id` | string | Account ID |
195
- | `transaction_id` | string | Transaction ID |
196
- | `category_id` | string | Category ID |
197
- | `amount` | number | Amount in milliunits |
198
- | `date` | string | Date in YYYY-MM-DD format |
199
- | `since_date` | string | Filter date in YYYY-MM-DD format |
200
-
201
- ### Amount Handling
202
-
203
- **Input (create/update)**:
204
- - Use milliunits: `$25.50` → `25500`
205
- - Negative for outflows: `$-50.00` → `-50000`
206
- - Positive for inflows: `$100.00` → `100000`
207
-
208
- **Output (list/get)**:
209
- - Automatically converted to dollars
210
- - Example: `25500` milliunits → `$25.50`
211
-
212
- ### Date Formats
213
-
214
- All dates must use ISO 8601 format: `YYYY-MM-DD`
215
-
216
- ✅ Valid: `2024-01-15`, `2024-12-31`
217
- ❌ Invalid: `01/15/2024`, `15-01-2024`, `2024-1-15`
218
-
219
- ---
220
-
221
- ## Quick Start Workflow
222
-
223
- ### 1. Initial Setup
224
-
225
- ```
226
- 1. list_budgets → Get budget IDs
227
- 2. set_default_budget → Set your budget
228
- 3. list_accounts → View accounts
229
- 4. list_categories → View categories
230
- ```
231
-
232
- ### 2. View Data
233
-
234
- ```
235
- 1. list_transactions → Recent transactions
236
- 2. get_month → Monthly budget data
237
- 3. list_payees → Available payees
238
- ```
239
-
240
- ### 3. Create Transaction
241
-
242
- ```
243
- 1. convert_amount → Convert dollars to milliunits
244
- 2. create_transaction → Create the transaction
245
- 3. get_transaction → Verify created transaction
246
- ```
247
-
248
- ### 4. Monitor & Debug
249
-
250
- ```
251
- 1. diagnostic_info → Check system health
252
- 2. clear_cache → Clear if data seems stale
253
- ```
254
-
255
- ---
256
-
257
- ## Error Responses
258
-
259
- All tools return consistent error formats:
260
-
261
- ```json
262
- {
263
- "success": false,
264
- "error": {
265
- "code": "ERROR_CODE",
266
- "message": "Human-readable error message",
267
- "details": {
268
- "additional": "context"
269
- }
270
- }
271
- }
272
- ```
273
-
274
- **Common Error Codes**:
275
- - `AUTHENTICATION_ERROR` - Invalid or expired token
276
- - `AUTHORIZATION_ERROR` - Insufficient permissions
277
- - `VALIDATION_ERROR` - Invalid parameters
278
- - `RESOURCE_NOT_FOUND` - Budget/account/transaction not found
279
- - `RATE_LIMIT_EXCEEDED` - Too many requests
280
- - `OPERATION_FAILED` - General failure
281
-
282
- ---
283
-
284
- ## Tool Selection Guide
285
-
286
- ### I want to...
287
-
288
- **View my budgets**
289
- → `list_budgets`, then `set_default_budget`
290
-
291
- **View account balances**
292
- → `list_accounts`
293
-
294
- **View recent transactions**
295
- → `list_transactions` with `since_date`
296
-
297
- **Create a transaction**
298
- → `create_transaction` (convert amount first)
299
-
300
- **Create split transaction from receipt**
301
- → `create_receipt_split_transaction`
302
-
303
- **Import bank transactions**
304
- → `compare_transactions` or `reconcile_account`
305
-
306
- **View spending by category**
307
- → `get_month` with target month
308
-
309
- **Check system health**
310
- → `diagnostic_info`
311
-
312
- **Troubleshoot cache issues**
313
- → `diagnostic_info` then `clear_cache` if needed
314
-
315
- ---
316
-
317
- ## Performance Tips
318
-
319
- 1. **Set Default Budget**: Always call `set_default_budget` first to:
320
- - Enable automatic budget ID resolution
321
- - Trigger cache warming for faster subsequent operations
322
-
323
- 2. **Leverage Caching**: Repeated calls to these tools are cached:
324
- - `list_accounts` - 30 min TTL
325
- - `list_categories` - 30 min TTL
326
- - `list_payees` - 30 min TTL
327
- - `get_month` - 5 min TTL
328
-
329
- 3. **Use Filters**: Narrow results with filters:
330
- - `list_transactions`: Use `since_date`, `account_id`
331
- - Reduces response size and improves performance
332
-
333
- 4. **Batch Operations**: For multiple transactions:
334
- - Use `export_transactions` for bulk reads
335
- - Process in batches of 5-10 for creates
336
-
337
- ---
338
-
339
- ## Additional Resources
340
-
341
- - **[Complete API Reference](API.md)** - Detailed documentation with examples
342
- - **[Development Guide](../guides/DEVELOPMENT.md)** - Common patterns and best practices
343
- - **[Troubleshooting](TROUBLESHOOTING.md)** - Common issues and solutions
344
- - **[Examples](EXAMPLES.md)** - Practical usage examples
345
-
346
- ---
347
-
348
- **Quick Links**: [API Reference](API.md) | [Development Guide](../guides/DEVELOPMENT.md) | [Troubleshooting](TROUBLESHOOTING.md)