list_reports
Retrieve available reports from Frappe Framework sites. Filter by module or limit results to find specific reports for data analysis and management.
Instructions
Get a list of all available reports in the system.
Args:
module: Filter reports by module (optional)
limit: Maximum number of reports to return (default: 50)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| module | No | ||
| limit | No |
Implementation Reference
- src/tools/reports.py:127-165 (handler)The main handler function for the 'list_reports' tool. It queries the Frappe API for a list of Report documents, optionally filtered by module and limited by count, formats the response nicely.@mcp.tool() async def list_reports( module: Optional[str] = None, limit: Optional[int] = 50 ) -> str: """ Get a list of all available reports in the system. Args: module: Filter reports by module (optional) limit: Maximum number of reports to return (default: 50) """ try: client = get_client() # Build parameters params = { "fields": json.dumps(["name", "report_type", "module", "is_standard", "ref_doctype"]), "limit": str(limit), "order_by": "name" } if module: params["filters"] = json.dumps({"module": module}) # Get reports list response = await client.get("api/resource/Report", params=params) if "data" in response: reports = response["data"] count = len(reports) filter_text = f" in module '{module}'" if module else "" return f"Found {count} reports{filter_text}:\n\n" + json.dumps(reports, indent=2) else: return json.dumps(response, indent=2) except Exception as error: return _format_error_response(error, "list_reports")