export_statistics
Export survey statistics from LimeSurvey in PDF, Excel, or HTML formats to analyze response data and generate reports.
Instructions
Export statistics for a LimeSurvey survey.
Args:
sid: The survey ID.
document_type: The document type (pdf, xls, html).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sid": "<sid>"
},
"name": "export_statistics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sid | Yes | ||
| document_type | No |
Implementation Reference
- main.py:340-350 (handler)The primary handler function for the 'export_statistics' MCP tool. It is decorated with @mcp.tool() which handles registration and schema inference from type hints and docstring. The function exports survey statistics using the LimeSurvey client.
@mcp.tool() def export_statistics(sid: int, document_type: str = "pdf") -> str: """Export statistics for a LimeSurvey survey. Args: sid: The survey ID. document_type: The document type (pdf, xls, html). """ with get_client() as client: return client.export_statistics(sid, file_format=document_type)