add_responses
Add multiple survey responses to a LimeSurvey survey using the survey ID and response data.
Instructions
Add multiple responses to a LimeSurvey survey.
Args:
sid: The survey ID.
responses: The responses to add.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sid | Yes | ||
| responses | Yes |
Implementation Reference
- main.py:267-276 (handler)The handler function for the 'add_responses' MCP tool. Decorated with @mcp.tool() for automatic registration and schema inference from type hints and docstring. Executes by creating a LimeSurvey Client and calling its add_responses method.@mcp.tool() def add_responses(sid: int, responses: list[dict]) -> str: """Add multiple responses to a LimeSurvey survey. Args: sid: The survey ID. responses: The responses to add. """ with get_client() as client: return client.add_responses(sid, responses)
- main.py:15-20 (helper)Helper function to create and return a configured LimeSurvey Client instance, used by the add_responses handler.def get_client() -> Client: return Client( url=os.getenv("LIMESURVEY_URL"), username=os.getenv("LIMESURVEY_USERNAME"), password=os.getenv("LIMESURVEY_PASSWORD"), )
- main.py:267-267 (registration)The @mcp.tool() decorator registers the add_responses function as an MCP tool.@mcp.tool()