add_participants
Enables adding participants to a LimeSurvey survey by specifying the survey ID and participant data. Facilitates efficient management of survey responses and data collection.
Instructions
Add participants to a LimeSurvey survey.
Args:
sid: The survey ID.
participant_data: The participant data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| participant_data | Yes | ||
| sid | Yes |
Implementation Reference
- main.py:558-570 (handler)The main handler function for the 'add_participants' MCP tool. It is decorated with @mcp.tool() which registers it, uses type hints for schema (sid: int, participant_data: list[dict[str, Any]] -> list[dict[str, Any]]), and executes the logic by creating a Citric Client and calling its add_participants method.@mcp.tool() def add_participants( sid: int, participant_data: list[dict[str, Any]] ) -> list[dict[str, Any]]: """Add participants to a LimeSurvey survey. Args: sid: The survey ID. participant_data: The participant data. """ with get_client() as client: return client.add_participants(sid, participant_data)
- main.py:15-21 (helper)Shared helper function to instantiate the LimeSurvey Client from the 'citric' library using environment variables, used by the add_participants 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"), )