add_response
Add survey responses to LimeSurvey using the survey ID and response data. Integrates with the LimeSurvey MCP Server to manage survey data efficiently.
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 |
|---|---|---|---|
| response | Yes | ||
| sid | Yes |
Implementation Reference
- main.py:255-264 (handler)The handler function for the 'add_response' MCP tool. It is registered via @mcp.tool() decorator and implements the tool logic by delegating to the citric Client library's add_response method.@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:255-255 (registration)The @mcp.tool() decorator registers the add_response function as an MCP tool.@mcp.tool()
- main.py:15-20 (helper)Helper function to create and return a configured 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"), )