Skip to main content
Glama

getGameDebugInfoWithLogsAndVisualization

Retrieve debug data, logs, and visualizations to analyze browser-based game performance and behavior for troubleshooting and optimization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeSvgNo

Implementation Reference

  • mcp.js:214-289 (handler)
    Handler function that increments request counters, checks for latestCapture, formats console logs and errors into text, optionally appends SVG visualization, and returns structured MCP content.
    }, async ({ includeSvg }) => {
      mcpRequestCount++;
      if (!includeSvg) {
        mcpRequestWithoutSvgCount++;
      }
      // Simply use the latest capture
      if (!latestCapture) {
        // Return basic response when no data is available
        return {
          success: false,
          content: [{
            type: "text",
            text: "No game data available yet."
          }]
        };
      }
      
      // Use the capture directly
      const capture = latestCapture;
      
      // Remove SVG if not explicitly requested
      if (!includeSvg && capture.vectorized) {
        delete capture.vectorized.svg;
      }
      
      // Extract console logs for easier viewing
      const consoleLogs = capture.console_logs.map(log => ({
        time: new Date(log.timestamp).toISOString(),
        message: log.data.join(' ')
      }));
      
      // Extract errors if any
      const errors = capture.console_errors.map(err => ({
        time: new Date(err.timestamp).toISOString(),
        message: err.data.join(' ')
      }));
      
      // Format the data for better MCP display
      // Create a text representation of the game state
      const textContent = `
    Game State: ${capture.id} (${new Date(capture.timestamp).toISOString()})
    
    Console Logs:
    ${consoleLogs.map(log => `[${log.time}] ${log.message}`).join('\n')}
    
    ${errors.length ? 'Errors:\n' + errors.map(err => `[${err.time}] ${err.message}`).join('\n') : 'No errors.'}
    ${capture.unhandled_exception ? `\nUnhandled Exception:\n${JSON.stringify(capture.unhandled_exception, null, 2)}` : ''}
    
    `;
    
      // Return in MCP-compatible format
      // Prepare result object
      const result = {
        success: true,
        content: [
          {
            type: "text",
            text: textContent
          }
        ]
      };
      
      // Only add SVG if we have it and it was requested
      if (capture.vectorized?.svg && includeSvg) {
        try {
          // Add SVG as text directly in the response
          result.content[0].text += "\nSVG Approximation:\n```svg\n" + capture.vectorized.svg + "\n```";
        } catch (error) {
          console.error("Error with SVG data:", error);
          // Add error note to text content
          result.content[0].text += "\n\nError processing SVG data";
        }
      }
      
      return result;
    });
  • Input schema using Zod: optional boolean 'includeSvg' parameter defaulting to true, controlling whether SVG visualization is included in the response.
    includeSvg: z.boolean().optional().default(true)
  • mcp.js:212-214 (registration)
    Registration of the tool 'getGameDebugInfoWithLogsAndVisualization' on the McpServer instance, specifying input schema and providing inline async handler function.
    mcpServer.tool("getGameDebugInfoWithLogsAndVisualization", {
      includeSvg: z.boolean().optional().default(true)
    }, async ({ includeSvg }) => {
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/monteslu/vibe-eyes'

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