Skip to main content
Glama

find_node

Locate nodes in Godot scenes by name, type, group, or script to manage scene trees and debug projects.

Instructions

Find nodes across all indexed scenes by name, type, group, or attached script.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoNode name to search for
typeNoGodot class name to filter by
groupNoGroup name to filter by
scriptNoScript path to filter by
maxResultsNoMaximum results to return

Implementation Reference

  • The 'find_node' tool registration and handler implementation in 'src/tools/scene-tools.ts', which accepts search parameters and calls the index's 'findNode' method.
    {
      name: "find_node",
      description: "Find nodes across all indexed scenes by name, type, group, or attached script.",
      schema: {
        name: z.string().optional().describe("Node name to search for"),
        type: z.string().optional().describe("Godot class name to filter by"),
        group: z.string().optional().describe("Group name to filter by"),
        script: z.string().optional().describe("Script path to filter by"),
        maxResults: z
          .number()
          .int()
          .min(1)
          .max(500)
          .optional()
          .default(50)
          .describe("Maximum results to return"),
      },
      handler: async (ctx) => {
        const { name, type, group, script, maxResults = 50 } = ctx.args;
    
        const results = await index.findNode({ name, type, group, script });
        const truncated = results.length > maxResults;
        const data = results.slice(0, maxResults).map((r) => ({
          name: r.node.name,
          type: r.node.type,
          nodePath: r.node.nodePath,
          scenePath: r.scenePath,
          script: r.node.script,
          groups: r.node.groups,
        }));
    
        return makeTextResponse({
          data,
          truncated,
          totalCount: results.length,
          metadata: { source: "index" },
        });
      },
    },
    
    {
  • The 'findNode' method implementation in 'src/index/unified-index.ts', which executes the search logic across indices.
    async findNode(options: {
      name?: string;
      type?: string;
      group?: string;
      script?: string;
    }): Promise<Array<{ node: NodeInfo; scenePath: string }>> {
      await this.ensureDerivedFresh();
    
      // Pick the narrowest index as the candidate set
      let candidates: Array<{ node: NodeInfo; scenePath: string }> | null = null;
    
      if (options.name) {
        candidates = this.byName.get(options.name) ?? [];
      }
      if (options.type) {
        const byType = this.nodeTypeIndex.findByType(options.type);
        if (!candidates || byType.length < candidates.length) {
          candidates = byType;
        }
      }
      if (options.group) {
        const byGroup = this.groupIndex.findByGroup(options.group);
        if (!candidates || byGroup.length < candidates.length) {
          candidates = byGroup;
        }
      }
      if (options.script) {
        const byScript = this.byScript.get(options.script) ?? [];
        if (!candidates || byScript.length < candidates.length) {
          candidates = byScript;
        }
      }
    
      // No filters specified — return all nodes
      if (!candidates) {
        const all: Array<{ node: NodeInfo; scenePath: string }> = [];
        for (const [scenePath, scene] of await this.sceneIndex.all()) {
          for (const [_nodePath, node] of scene.nodes) {
            all.push({ node, scenePath });
          }
        }
        return all;
      }
    
      // Apply remaining filters to the candidate set
      return candidates.filter((entry) => {
        if (options.name && entry.node.name !== options.name) return false;
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions searching 'across all indexed scenes' but does not disclose critical behaviors such as whether the search is case-sensitive, what 'indexed scenes' means, if there are performance limits, or what the output format looks like. This leaves significant gaps for a search tool.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core functionality. Every word contributes to understanding the tool's purpose without any redundancy or unnecessary detail.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It does not explain what 'indexed scenes' are, how results are returned (e.g., list format, pagination), or any error conditions. For a search tool with 5 parameters, this leaves too much unspecified for reliable use.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents all parameters. The description lists the search criteria ('by name, type, group, or attached script'), which aligns with the schema but adds no additional meaning beyond it. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Find nodes across all indexed scenes by name, type, group, or attached script.' It specifies the verb ('Find'), resource ('nodes'), and scope ('across all indexed scenes'), but does not explicitly differentiate from sibling tools like 'find_group_members' or 'find_scene_instances', which also search for nodes in specific contexts.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'find_group_members' (for nodes in a specific group) or 'find_scene_instances' (for nodes in a specific scene), leaving the agent to infer usage based on parameter names alone.

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

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