Skip to main content
Glama
sourcefuse

Robot Framework MCP Server

by sourcefuse

create_api_integration_test

Generate Robot Framework API integration test code for specified endpoints and methods, producing .robot file content without execution.

Instructions

Generate Robot Framework API integration test code. Returns .robot file content as text - does not execute.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_urlYes
endpointYes
methodNoGET

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function decorated with @mcp.tool(), implementing the tool logic to generate Robot Framework API integration test code using a template, with input validation.
    @mcp.tool()
    def create_api_integration_test(base_url: str, endpoint: str, method: str = "GET") -> str:
        """Generate Robot Framework API integration test code. Returns .robot file content as text - does not execute."""
        try:
            validated_url = InputValidator.validate_url(base_url)
            
            template = Template("""*** Settings ***
    Library    SeleniumLibrary
    Library    RequestsLibrary
    Library    Collections
    
    *** Variables ***
    $${BASE_URL}         $base_url
    $${API_ENDPOINT}     $endpoint
    $${BROWSER}          Chrome
    
    *** Test Cases ***
    API UI Integration Test
        [Documentation]    Test API and UI integration
        [Tags]    integration    api    ui
        
        # API Setup and Validation
        Create Session    api_session    $${BASE_URL}
        $${api_response}=    GET On Session    api_session    $${API_ENDPOINT}
        Status Should Be    200    $${api_response}
        $${response_data}=    Set Variable    $${api_response.json()}
        
        # UI Validation based on API data
        Open Browser    $${BASE_URL}    $${BROWSER}
        Maximize Browser Window
        
        # Validate UI reflects API data
        Wait Until Page Contains    $${response_data['title']}    10s
        Page Should Contain    $${response_data['description']}
        
        [Teardown]    Run Keywords
        ...    Close Browser    AND
        ...    Delete All Sessions
    
    *** Keywords ***
    Validate API Response Structure
        [Arguments]    $${response}
        [Documentation]    Validate API response has required fields
        Dictionary Should Contain Key    $${response}    id
        Dictionary Should Contain Key    $${response}    title
        Dictionary Should Contain Key    $${response}    description
    """)
            
            return template.substitute(
                base_url=validated_url,
                endpoint=endpoint,
                method=method.upper()
            )
            
        except ValidationError as e:
            return f"# VALIDATION ERROR: {str(e)}\n# Please correct the input and try again."
        except Exception as e:
            return f"# UNEXPECTED ERROR: {str(e)}\n# Please contact support."
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the tool 'Returns .robot file content as text - does not execute,' which clarifies output format and non-execution behavior. However, it lacks details on permissions, rate limits, error handling, or whether it modifies any state. The description is adequate but misses deeper behavioral traits for a code generation tool.

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 front-loaded: it states the core purpose in the first clause and adds critical behavioral context in the second. Every sentence earns its place with no wasted words, making it efficient for an AI agent to parse.

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

Completeness3/5

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

Given the tool has an output schema (which covers return values), the description doesn't need to explain outputs. However, with 3 parameters, 0% schema coverage, and no annotations, the description is incomplete: it lacks parameter semantics and deeper behavioral context. It's minimally viable but has clear gaps for a code generation tool.

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

Parameters2/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 adds no information about parameters like 'base_url', 'endpoint', or 'method' beyond what the schema provides. The description mentions 'API integration test' but doesn't explain how parameters relate to test generation, leaving semantics unclear. This fails to compensate for the low coverage.

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 API integration test code' with specific verb ('Generate') and resource ('Robot Framework API integration test code'). It distinguishes from siblings by focusing on API tests rather than Selenium, login, or syntax validation tools. However, it doesn't explicitly differentiate from 'create_data_driven_test' which might also involve API testing.

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 minimal usage guidance: it mentions the tool 'does not execute' the test, which is helpful context. However, it doesn't specify when to use this tool versus alternatives like 'create_data_driven_test' or 'create_performance_monitoring_test', nor does it provide prerequisites or typical scenarios for API integration testing.

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