Skip to main content
Glama

get_debug_template

Generate debug code templates for specific environments to log runtime data via HTTP POST, storing logs in the project directory for analysis.

Instructions

Get a debug code template for a specific environment. ⚠️ IMPORTANT INSTRUCTIONS FOR AI: 1) DO NOT use console.log() - the generated code uses HTTP POST to send logs to the debug server, 2) ALWAYS provide the projectPath parameter as the absolute path to the project directory (e.g., /path/to/project or process.cwd()), 3) The debug logs will be stored at {projectPath}/.debug/debug.log in the project directory, NOT in the user home directory. After getting the template, manually insert it into the appropriate location in the user's file. ⚠️ AFTER INSERTING DEBUG CODE: You MUST inform the user about: 1) What you suspect might be wrong, 2) What specific test steps they should take, 3) What results to expect, 4) How to report back the results. After user tests, use read_debug_logs to analyze the actual runtime data. ⚠️ MARKING TEMPORARY MODIFICATIONS: ANY temporary changes for debugging (including visual markers, test images, placeholder text, button label changes, color highlights, etc.) MUST be wrapped with clear comments: "// TEMPORARY DEBUG MARKER - WILL BE REVERTED" at the start and "// END TEMPORARY DEBUG MARKER" at the end. Keep a list of ALL temporary modifications (both debug code AND visual/test changes) and ensure ALL are reverted during cleanup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentYesRuntime environment: browser, node, python, php, react-native, wechat
logMessageYesThe log message to describe what is being logged
variablesNoVariable names to include in the log data
projectPathYes⚠️ REQUIRED: The absolute path to the project directory (e.g., /Users/username/project or D:\projects\myproject). This ensures logs are stored in the project directory at {projectPath}/.debug/debug.log, NOT in the user home directory. Use the current working directory of the project being debugged.
levelNoLog level: info, error, debug, warninfo

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/ahao0150/debug-mcp'

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