copy_survey
Duplicate an existing LimeSurvey survey to create a new version with a different name, saving time on survey setup.
Instructions
Copy a LimeSurvey survey.
Args:
sid: The source survey ID.
new_name: The name for the new survey.
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>",
"new_name": "<new_name>"
},
"name": "copy_survey"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sid | Yes | ||
| new_name | Yes |
Implementation Reference
- main.py:379-389 (handler)The handler function for the copy_survey tool. It creates a LimeSurvey client using get_client() and calls client.copy_survey(sid, new_name) to copy the survey and return the new survey ID. The @mcp.tool() decorator also serves as the registration.
@mcp.tool() def copy_survey(sid: int, new_name: str) -> int: """Copy a LimeSurvey survey. Args: sid: The source survey ID. new_name: The name for the new survey. """ with get_client() as client: return client.copy_survey(sid, new_name) - main.py:15-20 (helper)Helper function to create and return a citric Client instance using environment variables for authentication.
def get_client() -> Client: return Client( url=os.getenv("LIMESURVEY_URL"), username=os.getenv("LIMESURVEY_USERNAME"), password=os.getenv("LIMESURVEY_PASSWORD"), )