Skip to main content
Glama

get_console_output

Retrieve print statements, errors, and warnings captured during Godot scene execution. Use to debug runtime behavior without leaving your coding environment.

Instructions

Get console output from Godot debug session. Returns print() statements, errors, and warnings captured during scene execution. Requires an active debug session (run a scene with F5 in Godot). Use to debug runtime behavior, check print output, or monitor warnings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of entries to return (most recent). Default: all buffered.
categoryNoFilter by output category. console=print(), stdout=standard out, stderr=errors.
sinceNoUnix timestamp (ms). Only return entries after this time.

Implementation Reference

  • Main handler function for get_console_output tool. Checks DAP connection, validates inputs (category, limit, since), filters console output via ConsoleManager, and returns entries with total buffered count.
    export function getConsoleOutput(
      consoleManager: ConsoleManager,
      isDAPConnected: boolean,
      input: GetConsoleOutputInput
    ): GetConsoleOutputOutput {
      if (!isDAPConnected) {
        return {
          entries: [],
          total_buffered: 0,
          error: NO_DEBUG_SESSION_ERROR,
        };
      }
    
      // Validate category if provided
      const validCategories: DAPOutputCategory[] = ['console', 'stdout', 'stderr'];
      if (input.category && !validCategories.includes(input.category)) {
        throw new Error(`Invalid category: ${input.category}. Must be one of: ${validCategories.join(', ')}`);
      }
    
      // Validate limit if provided
      if (input.limit !== undefined && (typeof input.limit !== 'number' || input.limit < 0)) {
        throw new Error('limit must be a non-negative number');
      }
    
      // Validate since if provided
      if (input.since !== undefined && (typeof input.since !== 'number' || input.since < 0)) {
        throw new Error('since must be a non-negative timestamp');
      }
    
      const filter: ConsoleOutputFilter = {
        limit: input.limit,
        category: input.category,
        since: input.since,
      };
    
      const entries = consoleManager.getOutput(filter);
      const totalBuffered = consoleManager.size();
    
      return {
        entries,
        total_buffered: totalBuffered,
      };
    }
  • Input schema: GetConsoleOutputInput with optional limit, category (console/stdout/stderr), and since timestamp fields.
    export interface GetConsoleOutputInput {
      limit?: number;
      category?: DAPOutputCategory;
      since?: number;
    }
    
    export interface GetConsoleOutputOutput {
      entries: ConsoleOutput[];
      total_buffered: number;
      error?: string;
    }
  • Output schema: GetConsoleOutputOutput with entries array, total_buffered count, and optional error string.
    export interface GetConsoleOutputOutput {
      entries: ConsoleOutput[];
      total_buffered: number;
      error?: string;
    }
  • Tool schema registration object (getConsoleOutputTool) defining name 'get_console_output', description, and inputSchema for MCP.
    export const getConsoleOutputTool = {
      name: 'get_console_output',
      description:
        'Get console output from Godot debug session. ' +
        'Returns print() statements, errors, and warnings captured during scene execution. ' +
        'Requires an active debug session (run a scene with F5 in Godot). ' +
        'Use to debug runtime behavior, check print output, or monitor warnings.',
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'number',
            description: 'Maximum number of entries to return (most recent). Default: all buffered.',
          },
          category: {
            type: 'string',
            enum: ['console', 'stdout', 'stderr'],
            description: 'Filter by output category. console=print(), stdout=standard out, stderr=errors.',
          },
          since: {
            type: 'number',
            description: 'Unix timestamp (ms). Only return entries after this time.',
          },
        },
        required: [],
      },
    };
  • src/index.ts:148-163 (registration)
    CallToolRequestSchema handler in main server that dispatches 'get_console_output' by calling getConsoleOutput() with lazy DAP connection.
    if (name === 'get_console_output') {
      // Lazy connect: try to connect to DAP if not already connected
      await tryConnectDAP();
    
      const input = args as unknown as GetConsoleOutputInput;
      const result = getConsoleOutput(consoleManager, isDAPConnected, input);
    
      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?

Describes it as a read operation returning specific data types, and mentions a prerequisite. No annotations are present, so the description carries the burden and does so adequately without contradictions.

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 concise sentences that front-load the main action and provide necessary context without waste.

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

Completeness4/5

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

For a tool with 3 optional parameters and no output schema, the description explains the return value and a prerequisite, covering most gaps. Could mention limits or default behavior but is sufficient.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds no additional meaning beyond the schema, but the schema itself is clear.

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 the verb 'Get' and the resource 'console output from Godot debug session', and distinguishes from sibling tools like clear_console_output and get_diagnostics.

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

Usage Guidelines4/5

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

Provides clear use cases (debug runtime behavior, check print output, monitor warnings) and a prerequisite (active debug session), but does not explicitly mention when not to use or alternatives.

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