Skip to main content
Glama
sourcefuse

Robot Framework MCP Server

by sourcefuse

validate_robot_framework_syntax

Check Robot Framework code for syntax errors and receive validation feedback without executing the test scripts.

Instructions

Validate Robot Framework syntax and provide suggestions. Returns validation report as text - does not execute code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
robot_codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'validate_robot_framework_syntax' tool, decorated with @mcp.tool() for registration. It performs static syntax validation on Robot Framework code, checking for section headers, variable syntax, unclosed variables, and spacing issues, then returns a formatted validation report.
    @mcp.tool()
    def validate_robot_framework_syntax(robot_code: str) -> str:
        """Validate Robot Framework syntax and provide suggestions. Returns validation report as text - does not execute code."""
        try:
            lines = robot_code.split('\n')
            errors = []
            warnings = []
            
            # Check for basic syntax issues
            for i, line in enumerate(lines, 1):
                line_stripped = line.strip()
                if not line_stripped or line_stripped.startswith('#'):
                    continue
                    
                # Check for proper section headers
                if line_stripped.startswith('***') and not line_stripped.endswith('***'):
                    errors.append(f"Line {i}: Section header must end with '***'")
                
                # Check for proper variable syntax - should be ${variable} not ${{variable}}
                if '${{' in line and '}}' in line:
                    warnings.append(f"Line {i}: Use ${{variable}} syntax instead of ${{{{variable}}}}")
                
                # Check for unclosed variable syntax
                if '${' in line and '}' not in line:
                    errors.append(f"Line {i}: Unclosed variable syntax")
                
                # Check for proper spacing in variables section
                if line_stripped.startswith('${') and '    ' not in line:
                    warnings.append(f"Line {i}: Variables should use 4 spaces between name and value")
            
            result = "# ROBOT FRAMEWORK SYNTAX VALIDATION\n\n"
            
            if errors:
                result += "## ERRORS (Must Fix):\n"
                result += '\n'.join(f"- {error}" for error in errors) + "\n\n"
            
            if warnings:
                result += "## WARNINGS (Recommended Fixes):\n"
                result += '\n'.join(f"- {warning}" for warning in warnings) + "\n\n"
            
            if not errors and not warnings:
                result += "✅ VALIDATION PASSED: No syntax errors found\n"
            elif not errors:
                result += "⚠️  VALIDATION PASSED WITH WARNINGS: No critical errors, but consider fixing warnings\n"
            else:
                result += "❌ VALIDATION FAILED: Critical errors found that must be fixed\n"
            
            return result
                
        except Exception as e:
            return f"# VALIDATION ERROR: {str(e)}"
  • The @mcp.tool() decorator registers the validate_robot_framework_syntax function as an MCP tool.
    @mcp.tool()
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 adds value by specifying that it 'does not execute code' and returns a 'validation report as text,' which clarifies it's a read-only, non-destructive analysis tool. However, it doesn't cover aspects like error handling, performance limits, or authentication needs, leaving gaps in behavioral context.

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, consisting of two clear sentences that directly state the tool's function and key behavioral trait. Every word earns its place, with no redundant or unnecessary information, making it efficient and easy 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's moderate complexity (syntax validation), no annotations, and an output schema (which likely handles return values), the description is partially complete. It covers the core purpose and non-execution behavior but lacks details on parameters, error cases, or integration with sibling tools, leaving room for improvement in overall context.

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?

The input schema has 0% description coverage, with one parameter 'robot_code' undocumented in the schema. The description adds no information about this parameter (e.g., format, examples, or constraints), failing to compensate for the schema's lack of detail. This leaves the parameter's meaning unclear beyond its name.

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: 'Validate Robot Framework syntax and provide suggestions.' It specifies the verb (validate), resource (Robot Framework syntax), and outcome (suggestions). However, it doesn't explicitly differentiate from sibling tools (e.g., creation tools), which are focused on generating tests rather than validating syntax, so it falls short of 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 Guidelines3/5

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

The description implies usage by stating it 'does not execute code,' suggesting it's for static analysis rather than runtime testing. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., for syntax checking vs. creating tests with sibling tools) or any prerequisites, leaving usage context somewhat vague.

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