Skip to content

feat: add split transaction support and migrate build to tsup - #34

Closed
moosasharieff wants to merge 3 commits into
calebl:mainfrom
moosasharieff:main
Closed

moosasharieff wants to merge 3 commits into
calebl:mainfrom
moosasharieff:main

Conversation

@moosasharieff

@moosasharieff moosasharieff commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • Adds ynab_create_split_transaction tool to create transactions split across multiple budget categories via the YNAB subtransactions API
  • Updates ynab_get_transactions to include subtransactions in the response, making existing splits visible to AI clients
  • Replaces tsc with tsup (esbuild-based) for the build step — eliminates OOM crashes on large type graphs and reduces build time to ~240ms

New tool: ynab_create_split_transaction

Takes accountId, date, payeeId/payeeName, optional metadata, and a subtransactions array (min 2). Each split entry has an amount in dollars plus optional categoryId, memo, and payee overrides. The tool sets category_id: null on the parent transaction (required by the YNAB API for splits) and sums subtransaction amounts as the parent total.

Key API constraint: Updating subtransactions on existing splits is not supported by the YNAB API — this tool covers creation only.

Test plan

  • npm run build completes without errors
  • npm test — all 185 tests pass (17 files, including 16 new tests for CreateSplitTransactionTool)
  • Create a split transaction via the MCP inspector (npm run debug) and verify it appears in YNAB with correct categories and amounts
  • Fetch transactions via ynab_get_transactions and confirm subtransactions is populated for existing splits

…ns in get_transactions

- New CreateSplitTransactionTool creates transactions split across multiple categories via the YNAB subtransactions API
- Updated GetTransactionsTool to include subtransactions in response so existing splits are visible
- 16 new tests covering milliunit conversion, parent amount summing, validation, and error cases
@moosasharieff

Copy link
Copy Markdown
Author

Hi @calebl,

This PR is ready to merge. Can you please review and merge the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant