add_response
Submit survey responses to LimeSurvey surveys by providing survey ID and response data for data collection and analysis.
Instructions
Add a response to a LimeSurvey survey.
Args:
sid: The survey ID.
response: The response to add.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sid | Yes | ||
| response | Yes |
Implementation Reference
- main.py:255-264 (handler)The primary handler for the 'add_response' MCP tool. It is registered via the @mcp.tool() decorator and executes the tool logic by using a LimeSurvey client to add the response to the specified survey.@mcp.tool() def add_response(sid: int, response: dict) -> str: """Add a response to a LimeSurvey survey. Args: sid: The survey ID. response: The response to add. """ with get_client() as client: return client.add_response(sid, response)
- main.py:15-20 (helper)Helper function to create and return a LimeSurvey Client instance, used by the add_response handler.def get_client() -> Client: return Client( url=os.getenv("LIMESURVEY_URL"), username=os.getenv("LIMESURVEY_USERNAME"), password=os.getenv("LIMESURVEY_PASSWORD"), )
- main.py:255-255 (registration)The @mcp.tool() decorator registers the add_response function as an MCP tool.@mcp.tool()