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
Open
Add page and per_page in list_invoices tool and multi page in get_situation#3monossido wants to merge 4 commits intoaringad:mainfrom
monossido wants to merge 4 commits intoaringad:mainfrom
Conversation
…nally also in get_situation
There was a problem hiding this comment.
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_pageparameters to thelist_invoicestool schema and request. - Updated
list_invoicesimplementation to forward pagination parameters tolist_issued_documents. - Implemented internal multi-page fetching in
get_situationfor issued invoices, credit notes, and received expenses.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 | ||
| ) |
There was a problem hiding this comment.
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.
remove max per_page in page description Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Add page and per_page in list_invoices tool, support multi page internally also in get_situation