Skip to main content
Glama
minami110

GDScript Code Analyzer

by minami110

analyze_gdscript_code

Analyze GDScript code to extract its structure, functions, symbols, and dependencies for understanding Godot game engine codebases.

Instructions

Analyze GDScript code provided directly and extract its structure.

Input Schema

NameRequiredDescriptionDefault
codeYesGDScript source code to analyze

Input Schema (JSON Schema)

{ "properties": { "code": { "description": "GDScript source code to analyze", "type": "string" } }, "required": [ "code" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'analyze_gdscript_code' tool. It parses the input code using GDScriptParser, extracts symbols and structure, computes a summary, and returns the result as JSON.
    def _analyze_code(self, code: str) -> CallToolResult: """Analyze GDScript code provided directly. Args: code: GDScript source code Returns: CallToolResult with analysis """ try: tree = self.parser.parse(code) symbols = self.parser.get_symbols(tree) structure = self.parser.get_structure(tree, code) result = { "structure": structure, "symbols": symbols, "summary": { "total_classes": len(symbols["classes"]), "total_functions": len(symbols["functions"]), "total_signals": len(symbols["signals"]), "total_variables": len(symbols["variables"]), "total_enums": len(symbols["enums"]), }, } return CallToolResult( content=[TextContent(type="text", text=json.dumps(result, indent=2))], isError=False, ) except Exception as e: return CallToolResult( content=[TextContent(type="text", text=f"Error analyzing code: {str(e)}")], isError=True, )
  • The Tool schema definition including name, description, and input schema requiring a 'code' string parameter.
    Tool( name="analyze_gdscript_code", description="Analyze GDScript code provided directly and extract its structure.", inputSchema={ "type": "object", "properties": { "code": { "type": "string", "description": "GDScript source code to analyze", } }, "required": ["code"], }, ),
  • The dispatch registration in handle_tool_call that routes calls to the _analyze_code handler.
    elif tool_name == "analyze_gdscript_code": return self._analyze_code(tool_input["code"])

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/minami110/mcp-gdscript'

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