Skip to main content
Glama
edgarrmondragon

LimeSurvey MCP Server

upload_file

Add files to LimeSurvey surveys by uploading content with a specified name to a designated survey ID.

Instructions

Upload a file to a LimeSurvey survey.

Args:
    sid: The survey ID.
    file_content: The file content (base64 encoded).
    file_name: The file name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sidYes
file_contentYes
file_nameYes

Implementation Reference

  • main.py:669-680 (handler)
    The core handler function for the 'upload_file' MCP tool. Registered via @mcp.tool() decorator. It takes survey ID, base64-encoded file content, and filename, then uses a LimeSurvey client to perform the upload.
    @mcp.tool()
    def upload_file(sid: int, file_content: str, file_name: str) -> dict[str, Any]:
        """Upload a file to a LimeSurvey survey.
    
        Args:
            sid: The survey ID.
            file_content: The file content (base64 encoded).
            file_name: The file name.
        """
        with get_client() as client:
            return client.upload_file(sid, file_content, file_name)
  • main.py:669-669 (registration)
    The @mcp.tool() decorator registers the upload_file function as an MCP tool.
    @mcp.tool()
  • Type hints and docstring define the input schema (sid: int, file_content: str, file_name: str) and output (dict[str, Any]).
    def upload_file(sid: int, file_content: str, file_name: str) -> dict[str, Any]:
        """Upload a file to a LimeSurvey survey.
    
        Args:
            sid: The survey ID.
            file_content: The file content (base64 encoded).
            file_name: The file name.
        """
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Upload' implies a write/mutation operation, it doesn't specify authentication requirements, rate limits, file size restrictions, supported formats, or what happens on success/failure. The description mentions base64 encoding for file_content but provides no further behavioral context about the upload process.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The parameter documentation is structured clearly with bullet-like formatting. While efficient, the 'Args:' section could be more integrated with the main description rather than appearing as an afterthought.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens after upload (success indicators, returned file ID, error conditions), file constraints, or how this integrates with LimeSurvey's file management system. The lack of output information is particularly problematic for a write operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It lists all three parameters with brief explanations, adding meaning beyond the bare schema. However, it doesn't provide format details (e.g., sid format, file_name extensions), constraints, or examples. The base64 encoding note for file_content is helpful but insufficient for full parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Upload a file') and target resource ('to a LimeSurvey survey'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'download_files' or 'import_survey' that also handle files, leaving room for ambiguity about when to choose this specific upload method.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'download_files', 'import_survey', and 'import_question' that also handle file operations, there's no indication of when this upload method is appropriate versus other import/export mechanisms. No context about prerequisites or exclusions is mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/edgarrmondragon/limesurvey-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server