add_group
Create and manage survey groups in LimeSurvey by specifying the survey ID and group data. Simplify survey organization and structure with this MCP server tool.
Instructions
Add a group to a LimeSurvey survey.
Args:
sid: The survey ID.
group_data: The group data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_data | Yes | ||
| sid | Yes |
Implementation Reference
- main.py:437-447 (handler)The main handler function for the 'add_group' MCP tool. It is decorated with @mcp.tool() for registration and executes the tool logic by obtaining a LimeSurvey client via get_client() and calling client.add_group(sid, group_data). The input schema is defined by the function signature and docstring.@mcp.tool() def add_group(sid: int, group_data: dict[str, Any]) -> int: """Add a group to a LimeSurvey survey. Args: sid: The survey ID. group_data: The group data. """ with get_client() as client: return client.add_group(sid, group_data)
- main.py:15-20 (helper)Helper function used by the add_group tool (and others) to create an authenticated LimeSurvey Client instance from environment variables.def get_client() -> Client: return Client( url=os.getenv("LIMESURVEY_URL"), username=os.getenv("LIMESURVEY_USERNAME"), password=os.getenv("LIMESURVEY_PASSWORD"), )
- main.py:437-437 (registration)The @mcp.tool() decorator registers the add_group function as an MCP tool.@mcp.tool()