Expose missing data to the AI (account filters, achievements, score trend, investment txns)#16
Open
Expose missing data to the AI (account filters, achievements, score trend, investment txns)#16
Conversation
- TransactionFilters: add account, label, excludePending - getAccountBalances: return balance_limit for utilization calc - searchTransactions: optional account scope - New getScoreTrend for daily score history - Regression tests for new filters Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Filters: - get_transactions: account, label, include_pending - search_transactions: account - get_spending_summary: account, merchant New tools: - get_achievements, get_score_trend, get_investment_transactions - list_recat_rules, delete_recat_rule Output improvements: - get_accounts shows credit utilization when balance_limit present - get_recurring merges manual recurring_bills alongside Plaid streams Previously the AI could see this data in the schema but had no tool to query it, so it would tell users "I can't filter by account" even though transactions had account_id all along. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The AI was blind to data that existed in the schema but had no tool to query. This PR closes those gaps.
Filters on existing tools
get_transactions→account,label,include_pendingsearch_transactions→accountget_spending_summary→account,merchantNew tools
get_achievements— list unlocks (table was populated but unreadable)get_score_trend— daily score history (was latest-only)get_investment_transactions— buy/sell activity (table was seeded but unqueryable)list_recat_rules+delete_recat_rule— rule CRUD was write-only beforeOutput improvements
get_accountssurfaces credit utilization ("15% of $5,000 limit") whenbalance_limitis setget_recurringmerges manually-addedrecurring_billsalongside Plaid-detected streamsOrigin: user asked "what is my biggest expense in Free to Spend" and the AI said "I can't filter by account" — even though
transactions.account_idexists. Audit surfaced a handful of similar gaps.Test Coverage
account,label,excludePendingfilters ongetTransactionsFiltered, and account-scopedsearchTransactionsPaths not covered by unit tests: new AI handler cases (thin SQL + string formatting, consistent with existing tool handler pattern in the file). Credit utilization render path, recurring merge output, and investment transactions join are validated by the query-layer tests and manual verification.
Pre-Landing Review
Self-review of the diff:
?placeholdersgetAccountBalancesbehavior preserved; newbalance_limitcolumn additivegetTransactionsFiltereddefault behavior preserved — pending filter is opt-in (excludePending), so theray transactionsCLI is unchanged. AIget_transactionsdefaults to excluding pending, explicitly documented in the tool schemabalance_limitdelete_recat_rulefollows the same unauthenticated-by-ID pattern asdelete_budget/delete_goalget_investment_transactionscaps at LIMIT 50 by default to prevent large-portfolio blowupNotes
milestonestable was flagged during the gap audit but is untouched here — it has no writer or reader outside backup round-trip. Worth a separate cleanup PR to drop it if you want; goals already covers the same space with proper progress tracking.Test plan
npx tsc --noEmitcleannpm test— 108/108 passingray transactionsCLI still shows pending transactions (no behavior change)🤖 Generated with Claude Code