Skip to main content
Glama

scan_workspace_diagnostics

Scan all GDScript files in your Godot workspace to identify syntax errors, warnings, and code issues across your entire project.

Instructions

⚠️ EXPENSIVE: Scans ALL GDScript (.gd) files in workspace for errors, warnings, and issues (may take 5-30s for 100+ files). Use sparingly - only when you need to find problems across the entire codebase. For checking individual files, use get_diagnostics instead. Opens each .gd file (excluding addons/ and .godot/) to retrieve diagnostics from Godot Language Server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that checks LSP connection, scans workspace via DiagnosticsManager, computes stats, and returns formatted diagnostics output.
    export async function scanWorkspaceDiagnostics( diagnosticsManager: DiagnosticsManager, isConnected: boolean ): Promise<ScanWorkspaceOutput> { // Check if LSP is connected if (!isConnected) { return { files_scanned: 0, files_with_issues: 0, scan_time_seconds: 0, diagnostics: {}, error: `Godot LSP is not running. Please start Godot with your project: CLI: godot --editor --path /path/to/project GUI: Open the project in Godot Editor The Language Server Protocol must be enabled (default: ON) in: Project → Project Settings → Network → Language Server Once Godot is running, diagnostics will be available automatically.`, }; } const startTime = Date.now(); const diagnostics = await diagnosticsManager.scanWorkspace(); const scanTime = ((Date.now() - startTime) / 1000).toFixed(2); const filesScanned = Object.keys(diagnostics).length; const filesWithIssues = Object.values(diagnostics).filter((d) => d.length > 0).length; return { files_scanned: filesScanned, files_with_issues: filesWithIssues, scan_time_seconds: parseFloat(scanTime), diagnostics, }; }
  • Tool schema defining name, description, and empty input schema for MCP tool listing and validation.
    export const scanWorkspaceDiagnosticsTool = { name: 'scan_workspace_diagnostics', description: '⚠️ EXPENSIVE: Scans ALL GDScript (.gd) files in workspace for errors, warnings, and issues (may take 5-30s for 100+ files). Use sparingly - only when you need to find problems across the entire codebase. For checking individual files, use get_diagnostics instead. Opens each .gd file (excluding addons/ and .godot/) to retrieve diagnostics from Godot Language Server.', inputSchema: { type: 'object', properties: {}, required: [], }, };
  • TypeScript interface defining the structured output of the scan function.
    export interface ScanWorkspaceOutput { files_scanned: number; files_with_issues: number; scan_time_seconds: number; diagnostics: Record<string, Diagnostic[]>; error?: string; }
  • src/index.ts:62-64 (registration)
    Registers the tool in the MCP server's listTools handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [getDiagnosticsTool, scanWorkspaceDiagnosticsTool], }));
  • src/index.ts:84-95 (registration)
    Dispatches tool calls to the scanWorkspaceDiagnostics handler within the MCP callTool request handler.
    if (name === 'scan_workspace_diagnostics') { const result = await scanWorkspaceDiagnostics(diagnosticsManager, isConnected); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }

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/ryanmazzolini/minimal-godot-mcp'

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