Lint GLua Static Code
lint_gluaDetect syntax errors, realm violations, global pollution, and missing AddCSLuaFile calls in Garry's Mod Lua code with read-only static analysis.
Instructions
Perform deep static analysis and AST validation on Garry's Mod Lua (GLua) source code to detect syntax errors, realm boundary violations (server/client/menu mismatches), global namespace pollution, and missing AddCSLuaFile calls. Purely read-only static analysis requiring zero credentials or network access. Does NOT execute code and does NOT modify files on disk; when fix_formatting is true, the formatted code is returned strictly inside the result envelope without overwriting the source file. Provide either file_path (workspace-relative or absolute) or code_content (raw Lua snippet); when both are supplied, file_path takes precedence. If target_realm is 'auto', automatically detects the execution realm from file path prefixes (sv_, cl_, sh_) or defaults to 'shared'. Use this tool before committing code or running tests to ensure syntax and realm hygiene. Do NOT use for runtime performance profiling (use analyze_performance instead to detect GC allocations in render hooks), network vulnerability scanning (use audit_net_security instead), or functional test execution (use run_glua_test instead). Returns a GModToolResult envelope containing status ('success' or 'failed'), summary, data with valid (boolean), error_count, warning_count, realm_detected, diagnostics list (line, column, severity, rule code, message, suggestion), and optional formatted_code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | Workspace-relative or absolute path to .lua file to lint. Takes precedence over code_content when both are provided. | |
| code_content | No | Direct GLua source code string to analyze statically. Used when file_path is omitted. | |
| target_realm | No | Target execution realm context for static analysis ('server', 'client', 'shared', 'menu', or 'auto'). 'auto' infers realm from filename conventions (sv_, cl_, sh_) or defaults to 'shared'. | auto |
| fix_formatting | No | When true, runs glualint auto-fixer and returns formatted_code in the result data without mutating or overwriting the file on disk (default is false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Domain-specific typed payload returned by the tool. | |
| status | Yes | Execution status of the tool call ('success', 'partial', 'blocked', or 'failed'). | |
| summary | Yes | Concise, human-readable summary of operational findings, diagnostics, or execution outcome. | |
| evidence | Yes | Traceability evidence including cited documentation and generated artifacts. | |
| warnings | Yes | List of non-fatal warnings, lint advisories, engine caveats, or security notices. | |
| nextActions | No | Actionable, ordered recommendations for the agent's immediate next steps. |