import_survey
Import a LimeSurvey survey file to create a new survey in the system. Upload a base64-encoded survey file and optionally name the imported survey.
Instructions
Import a LimeSurvey survey.
Args:
survey_file: The survey file content (base64 encoded).
survey_name: The name for the imported survey.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| survey_file | Yes | ||
| survey_name | No |
Implementation Reference
- main.py:413-422 (handler)The main handler function for the 'import_survey' MCP tool. It is decorated with @mcp.tool() which registers it, takes base64-encoded survey file and optional name, and delegates to the LimeSurvey client's import_survey method.@mcp.tool() def import_survey(survey_file: str, survey_name: str = None) -> int: """Import a LimeSurvey survey. Args: survey_file: The survey file content (base64 encoded). survey_name: The name for the imported survey. """ with get_client() as client: return client.import_survey(survey_file, survey_name)
- main.py:15-20 (helper)Helper function to create and return a LimeSurvey Client instance using environment variables, used by the import_survey tool.def get_client() -> Client: return Client( url=os.getenv("LIMESURVEY_URL"), username=os.getenv("LIMESURVEY_USERNAME"), password=os.getenv("LIMESURVEY_PASSWORD"), )