Skip to main content
Glama
sourcefuse

Robot Framework MCP Server

by sourcefuse

create_data_driven_test

Generate Robot Framework data-driven test templates from CSV files to automate repetitive test scenarios efficiently.

Instructions

Generate Robot Framework data-driven test template code. Returns .robot file content as text - does not execute.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
test_data_fileNotest_data.csv

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'create_data_driven_test' tool, decorated with @mcp.tool() for registration in the FastMCP server. It generates a Robot Framework data-driven test template using the provided test_data_file, including DataDriver library integration, variables, test cases, and keywords for login testing.
    @mcp.tool()
    def create_data_driven_test(test_data_file: str = "test_data.csv") -> str:
        """Generate Robot Framework data-driven test template code. Returns .robot file content as text - does not execute."""
        template = f"""*** Settings ***
    Library    SeleniumLibrary
    Library    DataDriver    {test_data_file}    encoding=utf-8
    Test Template    Login Test Template
    
    *** Variables ***
    ${{BROWSER}}        Chrome
    ${{BASE_URL}}       https://www.appurl.com
    
    *** Test Cases ***
    Login Test With ${{username}} And ${{password}}
        [Tags]    data-driven    login
        # Test case will be generated for each row in CSV
    
    *** Keywords ***
    Login Test Template
        [Arguments]    ${{username}}    ${{password}}    ${{expected_result}}
        [Documentation]    Template for data-driven login tests
        
        Open Browser    ${{BASE_URL}}    ${{BROWSER}}
        Maximize Browser Window
        
        Input Text    id=user-name    ${{username}}
        Input Text    id=password    ${{password}}
        Click Button    id=login-button
        
        Run Keyword If    '${{expected_result}}' == 'success'
        ...    Wait Until Page Contains Element    xpath=//span[@class='title']    10s
        ...    ELSE
        ...    Wait Until Page Contains Element    xpath=//h3[@data-test='error']    10s
        
        [Teardown]    Close Browser
    
    *** Comments ***
    # Create {test_data_file} with columns: username,password,expected_result
    # Example CSV content:
    # username,password,expected_result
    # standard_user,secret_sauce,success
    # locked_out_user,secret_sauce,error
    # invalid_user,wrong_password,error
    """
        return template
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool generates code and returns file content as text without execution, which clarifies it's a read-only generation tool (not a write/execution tool). However, it lacks details on permissions, rate limits, error handling, or what happens with invalid inputs. This provides basic transparency but leaves gaps for a mutation-like operation.

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

Conciseness5/5

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

The description is highly concise and well-structured in a single sentence. It front-loads the core purpose ('Generate Robot Framework data-driven test template code') and efficiently adds key details about the output format and non-execution behavior. Every word earns its place with no redundancy or fluff, making it easy to parse quickly.

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

Completeness4/5

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

Given the tool's moderate complexity (generating test code), no annotations, and an output schema present (which likely covers return values), the description is reasonably complete. It specifies the action, output format, and a key behavioral trait (no execution). However, it lacks details on prerequisites (e.g., file format requirements) and doesn't fully address parameter semantics, leaving some contextual gaps.

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?

The description adds no parameter-specific information beyond what the input schema provides. With 1 parameter and 0% schema description coverage, the schema only gives a title ('Test Data File'), default value, and type. The description doesn't explain the parameter's role (e.g., that 'test_data_file' is the source for data-driven tests), leaving semantics unclear. Baseline is 3 due to low parameter count, but it doesn't compensate for the coverage gap.

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 tool's purpose: 'Generate Robot Framework data-driven test template code.' It specifies the verb ('Generate'), resource ('Robot Framework data-driven test template code'), and output format ('.robot file content as text'), distinguishing it from siblings like 'validate_robot_framework_syntax' or 'create_login_test_case'. However, it doesn't explicitly differentiate from all siblings (e.g., 'create_api_integration_test'), which prevents a perfect score.

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. It mentions that it 'does not execute,' which hints at a limitation, but doesn't specify scenarios where this tool is appropriate (e.g., for generating test templates from data files) or when to choose other tools like 'create_advanced_selenium_keywords' or 'create_performance_monitoring_test'. Without explicit usage context or exclusions, the score is low.

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/sourcefuse/robotframework-mcp'

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