update_response
Modify existing survey responses in LimeSurvey by providing survey ID, response ID, and updated data to correct or update participant answers.
Instructions
Update a response in a LimeSurvey survey.
Args:
sid: The survey ID.
response_id: The response ID.
response: The updated response.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sid": "<sid>",
"response_id": "<response_id>",
"response": "<response>"
},
"name": "update_response"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sid | Yes | ||
| response_id | Yes | ||
| response | Yes |
Implementation Reference
- main.py:279-290 (handler)The handler function for the 'update_response' MCP tool. It is decorated with @mcp.tool() for registration and implements the tool logic by delegating to the LimeSurvey Client's update_response method via a context-managed client instance.
@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:15-21 (helper)Helper function to create and return a configured LimeSurvey Client instance, used by the update_response handler and other tools.
def get_client() -> Client: return Client( url=os.getenv("LIMESURVEY_URL"), username=os.getenv("LIMESURVEY_USERNAME"), password=os.getenv("LIMESURVEY_PASSWORD"), ) - main.py:279-279 (registration)The @mcp.tool() decorator registers the update_response function as an MCP tool.
@mcp.tool()