get_report
Retrieve financial reports including profit/loss statements, tax summaries, and payment collections from FreshBooks for specified date ranges.
Instructions
Get a financial report. Types: profitloss_entity, taxsummary, payments_collected. Dates as YYYY-MM-DD.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| report_type | Yes | ||
| start_date | No | ||
| end_date | No |
Implementation Reference
- src/mcp_freshbooks/client.py:194-202 (handler)The implementation of the get_report tool logic which calls the FreshBooks API.
async def get_report(report_type: str, params: dict | None = None) -> dict: """Fetch an accounting report.""" account_id, _ = await get_ids() url = f"{ACCOUNTING_BASE}/{account_id}/reports/accounting/{report_type}" headers = await _get_headers() async with httpx.AsyncClient() as client: resp = await client.get(url, headers=headers, params=params or {}) resp.raise_for_status() return resp.json()["response"]["result"] - src/mcp_freshbooks/server.py:498-512 (registration)The MCP tool registration and handler entry point for 'get_report'.
@mcp.tool() @_handle_errors async def get_report( report_type: str, start_date: str | None = None, end_date: str | None = None, ) -> str: """Get a financial report. Types: profitloss_entity, taxsummary, payments_collected. Dates as YYYY-MM-DD.""" params = {} if start_date: params["start_date"] = start_date if end_date: params["end_date"] = end_date result = await client.get_report(report_type, params) return _fmt(result)