export_responses
Export survey responses from LimeSurvey in formats like CSV or JSON, with options for language and heading customization.
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 |
|---|---|---|---|
| sid | Yes | ||
| file_format | No | csv | |
| language | No | ||
| heading_type | No | code |
Implementation Reference
- main.py:316-338 (handler)The @mcp.tool()-decorated handler function implementing the 'export_responses' tool logic. It uses the citric Client to export survey responses in the specified format and returns the decoded content as a string.@mcp.tool() 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")