Skip to main content
Glama

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
NameRequiredDescriptionDefault
moduleNo
limitNo

Implementation Reference

  • 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")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/appliedrelevance/frappe-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server