Riddy21 / Riddy21/Friday_Budgeting_Pro

[P5] savings() tool — savings rate + monthly trend

Open
#283 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

task
Dominant language
Python
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Summary

Add a new savings_summary MCP tool that returns the user's savings rate and a monthly savings trend.

Requirements

  1. Add a new MCP tool savings_summary(period: str) in server/main.py:

    • Accepts same period strings as summary(): month, year, ytd, YYYY-MM, YYYY
    • Returns:
      {
        "period": "2026-05",
        "income": 5000.00,
        "savings": 800.00,
        "savings_rate": 16.0,
        "monthly_trend": [
          {"month": "2026-03", "income": 5000, "savings": 700, "rate": 14.0},
          {"month": "2026-04", "income": 5000, "savings": 750, "rate": 15.0},
          {"month": "2026-05", "income": 5000, "savings": 800, "rate": 16.0}
        ]
      }
      
    • savings = sum of transaction_entries.amount where entry_type = 'savings'
    • savings_rate = (savings / income) × 100, rounded to 1 decimal; 0.0 if income is zero
    • monthly_trend = last 3 full months (always 3 entries, 0-filled if no data)
  2. Register the tool with @mcp.tool decorator

  3. Add to SKILL.md under the appropriate section

  4. Add tests in tests/ covering the calculation and edge cases (zero income, no savings data)

  5. Update ARCHITECTURE.md MCP Tools section

Interactive check

Call the tool directly in Python and confirm it returns real output (not not_implemented).

Depends on

#281 (savings item_type must exist before this tool is meaningful)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in server/main.py by examining the existing summary() period handling and MCP tool registration. Add tests under tests/ for savings-rate calculation, zero income, missing savings data, and three zero-filled monthly entries. Update SKILL.md and ARCHITECTURE.md as requested, then call the tool directly in Python to confirm it returns the specified real output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.