Skip to main content
Glama
agenticcontrolio

TwinCAT Validator MCP Server

get_validation_summary

Generate a high-level quality summary with health score for TwinCAT XML files to assess structural validation and code quality.

Instructions

Get high-level file quality summary with health score.

Args: file_path: Path to TwinCAT file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function 'get_validation_summary' which calculates a health score and provides a summary of validation issues for a TwinCAT file.
    def get_validation_summary(file_path: str) -> str:
        """Get high-level file quality summary with health score.
    
        Args:
            file_path: Path to TwinCAT file
        """
        _t0 = time.monotonic()
        try:
            path, error = _validate_file_path(file_path, start_time=_t0)
            if error:
                return error
    
            file = TwinCATFile.from_path(path)
            engine_result = validation_engine.validate(file, "all")
    
            health_score = 100
            health_score -= engine_result.errors * 25
            health_score -= engine_result.warnings * 5
            health_score -= engine_result.infos * 1
            health_score = max(0, min(100, health_score))
    
            if health_score >= 90:
                status = "excellent"
            elif health_score >= 70:
                status = "good"
            elif health_score >= 50:
                status = "needs_work"
            else:
                status = "critical_issues"
    
            quick_fixes = sum(1 for issue in engine_result.issues if issue.fix_available)
    
            if quick_fixes == 0:
                fix_time = "No fixes needed"
            elif quick_fixes <= 3:
                fix_time = "< 1 minute"
            elif quick_fixes <= 10:
                fix_time = "1-2 minutes"
            else:
                fix_time = "2-5 minutes"
    
            result = {
                "success": True,
                "file_path": str(path),
                "health_score": health_score,
                "status": status,
                "issue_breakdown": {
                    "critical": engine_result.errors,
                    "warnings": engine_result.warnings,
                    "info": engine_result.infos,
                },
                "quick_fixes_available": quick_fixes,
                "estimated_fix_time": fix_time,
            }
    
            return _with_meta(result, _t0)
    
        except Exception as e:
            return _tool_error(str(e), file_path=file_path, start_time=_t0)
Behavior2/5

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

With no annotations provided, the description carries full behavioral disclosure burden. While 'Get' implies read-only access, the description fails to clarify whether this triggers validation computation or retrieves cached results, what the health score represents (scale/format), or error handling behavior.

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?

Extremely concise with no redundant text. The two-sentence structure (purpose statement followed by Args documentation) is efficient and appropriately front-loaded, though brevity sacrifices contextual richness.

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?

Given 15 sibling tools including multiple validation variants, the description is insufficient for tool selection. The existence of an output schema reduces the need for return value documentation, but the crowded namespace demands explicit comparison criteria that are absent.

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

Parameters4/5

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

Compensates effectively for 0% schema description coverage by specifying that file_path represents a 'Path to TwinCAT file' (adding domain context 'TwinCAT' that the schema lacks). The Args structure efficiently documents the single parameter's semantics.

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 uses specific verbs ('Get') and clearly identifies the resource ('high-level file quality summary with health score'). However, it lacks explicit differentiation from validation-related siblings like 'validate_file' or 'check_specific', leaving ambiguity about whether this retrieves cached data or performs live analysis.

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?

No guidance provided on when to use this tool versus the numerous validation alternatives (validate_file, validate_batch, check_specific). No prerequisites, constraints, or selection criteria are 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/agenticcontrolio/twincat-validator-mcp'

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