Skip to content

Add page and per_page in list_invoices tool and multi page in get_situation#3

Open
monossido wants to merge 4 commits intoaringad:mainfrom
monossido:main
Open

Add page and per_page in list_invoices tool and multi page in get_situation#3
monossido wants to merge 4 commits intoaringad:mainfrom
monossido:main

Conversation

@monossido
Copy link
Copy Markdown

Add page and per_page in list_invoices tool, support multi page internally also in get_situation

Copilot AI review requested due to automatic review settings April 24, 2026 23:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the MCP server’s accounting tools to support pagination when listing issued invoices and to compute the yearly “situation” dashboard across multiple API pages (instead of only the first 100 records).

Changes:

  • Added page / per_page parameters to the list_invoices tool schema and request.
  • Updated list_invoices implementation to forward pagination parameters to list_issued_documents.
  • Implemented internal multi-page fetching in get_situation for issued invoices, credit notes, and received expenses.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server.py Outdated
Comment thread server.py
Comment thread server.py
Comment thread server.py
Comment on lines 1123 to 1126
totale_costi = sum(
d.to_dict().get('amount_gross') or d.to_dict().get('amount_net') or 0
for d in (ricevute_resp.data or [])
for d in all_expenses
)
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nel calcolo di totale_costi viene chiamato d.to_dict() due volte per ogni documento (amount_gross e amount_net). Convertire una sola volta per elemento (o usare attributi diretti se disponibili) evita lavoro duplicato, soprattutto ora che vengono caricati più page di spese.

Copilot uses AI. Check for mistakes.
Comment thread server.py
monossido and others added 3 commits April 25, 2026 01:50
remove max per_page in page description

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants