update_response
Modify survey responses in LimeSurvey using the survey ID and response ID. Ensure accurate and updated survey data by editing specific responses within the platform.
Instructions
Update a response in a LimeSurvey survey.
Args:
sid: The survey ID.
response_id: The response ID.
response: The updated response.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| response | Yes | ||
| response_id | Yes | ||
| sid | Yes |
Implementation Reference
- main.py:279-289 (handler)The core handler function for the 'update_response' MCP tool. It is registered via the @mcp.tool() decorator and implements the tool logic by delegating to the LimeSurvey client's update_response method. The type hints and docstring define the input schema.@mcp.tool() def update_response(sid: int, response_id: int, response: dict) -> str: """Update a response in a LimeSurvey survey. Args: sid: The survey ID. response_id: The response ID. response: The updated response. """ with get_client() as client: return client.update_response(sid, response_id, response)
- main.py:279-279 (registration)The @mcp.tool() decorator registers the update_response function as an MCP tool.@mcp.tool()
- main.py:15-20 (helper)Helper function to create the LimeSurvey Client instance used by the update_response handler.def get_client() -> Client: return Client( url=os.getenv("LIMESURVEY_URL"), username=os.getenv("LIMESURVEY_USERNAME"), password=os.getenv("LIMESURVEY_PASSWORD"), )