Skip to main content
Glama

get_console_output

Retrieve console output from a running Godot project to monitor logs, debug issues, and filter by text or error level for focused analysis.

Instructions

Get console output from the running Godot project. Optionally filter by text or error level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoText filter for console output
errorsOnlyNoOnly show errors and warnings

Implementation Reference

  • The _get_console_output function reads the latest log file from the logs directory and returns the last 100 lines as the console output.
    func _get_console_output(_params: Dictionary) -> Dictionary:
    \tvar log_dir := OS.get_user_data_dir() + "/logs"
    \tvar dir := DirAccess.open(log_dir)
    \tif not dir:
    \t\treturn {"output": [], "note": "No log directory found"}
    \tvar files: Array[String] = []
    \tdir.list_dir_begin()
    \tvar file_name := dir.get_next()
    \twhile file_name != "":
    \t\tif file_name.ends_with(".log"):
    \t\t\tfiles.append(file_name)
    \t\tfile_name = dir.get_next()
    \tdir.list_dir_end()
    \tif files.is_empty():
    \t\treturn {"output": [], "note": "No log files found"}
    \tfiles.sort()
    \tvar latest := files[-1]
    \tvar f := FileAccess.open(log_dir + "/" + latest, FileAccess.READ)
    \tif not f:
    \t\treturn {"output": [], "note": "Could not open log file"}
    \tvar content := f.get_as_text()
    \tf.close()
    \tvar lines := content.split("\\n")
    \tvar tail_count := 100
    \tvar start := max(0, lines.size() - tail_count)
    \tvar tail: Array[String] = []
    \tfor i in range(start, lines.size()):
    \t\tif lines[i].strip_edges() != "":
    \t\t\ttail.append(lines[i])
    \treturn {"output": tail, "file": latest}

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/woohq/godette-mcp'

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