Skip to main content
Glama

validate_robot_framework_syntax

Check and validate Robot Framework syntax without executing code. Provides a detailed validation report to identify and correct errors in 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

Implementation Reference

  • The @mcp.tool()-decorated handler function that implements the 'validate_robot_framework_syntax' tool. It checks Robot Framework code for syntax errors and warnings, such as section headers, variable syntax, and spacing, and 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 function as an MCP tool.
    @mcp.tool()
  • Type annotations (robot_code: str -> str) and docstring define the input schema and description for the 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."""

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