export_responses
Export survey responses in various formats (CSV, JSON) from LimeSurvey using survey ID, language, and heading type options for structured data retrieval.
Instructions
Export responses from a LimeSurvey survey.
Args:
sid: The survey ID.
file_format: The format to export (csv, json, etc).
language: The language to export (en, es, etc).
heading_type: The type of heading to export (code, full, abbreviated).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_format | No | csv | |
| heading_type | No | code | |
| language | No | ||
| sid | Yes |
Implementation Reference
- main.py:317-338 (handler)The main handler function implementing the export_responses tool. It takes survey ID and export options, uses the LimeSurvey client to export responses in the specified format, and returns the decoded content as a string.def export_responses( sid: int, file_format: str = "csv", language: str | None = None, heading_type: str = "code", ) -> str: """Export responses from a LimeSurvey survey. Args: sid: The survey ID. file_format: The format to export (csv, json, etc). language: The language to export (en, es, etc). heading_type: The type of heading to export (code, full, abbreviated). """ with get_client() as client: return client.export_responses( sid, file_format=file_format, language=language, heading_type=heading_type, ).decode("utf-8")
- main.py:316-316 (registration)The @mcp.tool() decorator registers the export_responses function as an MCP tool.@mcp.tool()