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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It doesn't mention whether this is a read-only operation, if it requires authentication, what the output format is, or any rate limits or constraints beyond the parameters. This is inadequate for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first in a clear sentence. The parameter explanations are concise, though the formatting with 'Args:' is slightly verbose. Overall, it avoids unnecessary fluff and earns its place efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 optional parameters) and the presence of an output schema, the description is minimally adequate. However, with no annotations and low schema coverage, it should do more to explain behavioral aspects like authentication needs or output structure. The output schema mitigates some gaps, but overall completeness is just sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal value beyond the input schema, which has 0% description coverage. It mentions the parameters ('module' and 'limit') and their purposes (filtering and limiting), but doesn't explain what 'module' refers to, valid values, or the behavior when limits are exceeded. Since schema coverage is low, this partial compensation earns a baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('list of all available reports'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_report_columns' or 'get_report_meta', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_report_columns' or 'run_doctype_report'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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