Skip to main content
Glama

scan_workspace_diagnostics

Scans all .gd files in the project directory for GDScript errors and warnings, excluding addons and .godot folders. Returns a complete list of diagnostics across the workspace.

Instructions

Scan entire workspace for GDScript errors across all .gd files (~1-2s for 100+ files). Returns errors from all .gd files excluding addons/ and .godot/. Use to find all errors/warnings in the project. For single-file checks, use get_diagnostics instead (<1s).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that scans the entire workspace for GDScript diagnostics. Calls diagnosticsManager.scanWorkspace() and returns results with file counts and scan timing.
    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: LSP_NOT_RUNNING_ERROR,
        };
      }
    
      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,
      };
    }
  • Output type definition for the scan_workspace_diagnostics tool: files_scanned, files_with_issues, scan_time_seconds, diagnostics map, and optional error.
    export interface ScanWorkspaceOutput {
      files_scanned: number;
      files_with_issues: number;
      scan_time_seconds: number;
      diagnostics: Record<string, Diagnostic[]>;
      error?: string;
    }
  • Tool definition/schema object for MCP registration with name 'scan_workspace_diagnostics', description, and input schema (no inputs required).
    export const scanWorkspaceDiagnosticsTool = {
      name: 'scan_workspace_diagnostics',
      description:
        'Scan entire workspace for GDScript errors across all .gd files (~1-2s for 100+ files). ' +
        'Returns errors from all .gd files excluding addons/ and .godot/. ' +
        'Use to find all errors/warnings in the project. ' +
        'For single-file checks, use get_diagnostics instead (<1s).',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    };
  • src/index.ts:108-115 (registration)
    Registration of the tool in the MCP server's list of available tools via ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        getDiagnosticsTool,
        scanWorkspaceDiagnosticsTool,
        getConsoleOutputTool,
        clearConsoleOutputTool,
      ],
    }));
  • src/index.ts:135-146 (registration)
    Tool call handler that dispatches to scanWorkspaceDiagnostics when name === 'scan_workspace_diagnostics'.
    if (name === 'scan_workspace_diagnostics') {
      const result = await scanWorkspaceDiagnostics(diagnosticsManager, isConnected);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
Behavior4/5

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

No annotations provided, so description carries burden. It discloses scope, exclusions, and performance (~1-2s). While it implies a read operation, it does not explicitly state non-destructiveness, but context suggests it.

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?

Two sentences, front-loaded with key information, no wasted words. Efficiently conveys purpose, scope, performance, and alternative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters, no output schema, and simple operation, the description covers all needed context: what, where, when, performance, and alternative.

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?

No parameters exist, so schema coverage is 100%. The description adds context about what is scanned and excluded, which is sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it scans the entire workspace for GDScript errors across all .gd files, excluding addons/ and .godot/. It distinguishes from the sibling tool get_diagnostics for single-file checks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

It provides explicit guidance: use for finding all errors/warnings in the project, and for single-file checks, use get_diagnostics instead. Also includes time estimates.

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

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