Skip to main content
Glama

godot_run_script

Execute GDScript code within the Godot editor to query engine state, access project settings, or perform quick operations using EditorScript functionality.

Instructions

Executes a GDScript expression or block in the Godot editor context (via EditorScript). Useful for querying engine state or performing quick operations.

Args:

  • code (string): GDScript code to execute. Should be a valid expression or a series of statements. Has access to: Engine, ProjectSettings, EditorInterface (in editor context).

  • timeout_ms (number, optional): Max execution time in milliseconds (default: 5000, max: 30000).

Returns: { success: boolean, output: string, error?: string }

Examples:

  • Use when: "What is the current project name?" -> code: "ProjectSettings.get_setting('application/config/name')"

  • Use when: "List all files in res://levels/" -> code: "DirAccess.get_files_at('res://levels/')"

Warning: This runs arbitrary code in the editor. Use with care.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesGDScript code to execute
timeout_msNoExecution timeout in ms

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/ricky-yosh/godot-mcp-server'

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