Skip to main content
Glama

godot_search_docs

Search local Godot documentation for classes, methods, properties, signals, and constants using free-text queries or specific filters to find relevant engine information.

Instructions

Search the exact local Godot docs for the installed engine version, including class, method, property, signal, and constant docs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoFree-text query, such as 'add child node' or 'timer start one shot'.
class_nameNoOptional class filter or exact class lookup, such as Node, Timer, Sprite2D, or CharacterBody3D.
member_nameNoOptional member filter or exact member lookup, such as add_child, start, position, or ready.
member_typeNoOptional result type filter: any, class, method, property, signal, or constant.any
max_resultsNoMaximum number of matches to return.
refresh_cacheNoWhether to rebuild the local docs cache from the selected Godot executable.
godot_executableNoOptional explicit path to the Godot executable or .app bundle.

Implementation Reference

  • The actual implementation logic for the search_docs tool.
    def search_docs(
        self,
        query: str | None = None,
        class_name: str | None = None,
        member_name: str | None = None,
        member_type: str = "any",
        max_results: int = 8,
        refresh_cache: bool = False,
        godot_executable: str | None = None,
    ) -> dict[str, Any]:
        executable, version = resolve_godot_executable(godot_executable)
    
        search_query = (query or "").strip()
        class_filter = (class_name or "").strip()
        member_filter = (member_name or "").strip()
        kind_filter = member_type.strip().lower() or "any"
        if kind_filter not in {"any", "class", "method", "property", "signal", "constant"}:
            raise GodotError(
                "`member_type` must be one of: any, class, method, property, signal, constant."
            )
        if max_results < 1:
            raise GodotError("`max_results` must be at least 1.")
        if not (search_query or class_filter or member_filter):
            raise GodotError("Provide at least one of `query`, `class_name`, or `member_name`.")
    
        docs_path, docs_api = self._get_docs_api(
            executable=executable,
            version=version,
            refresh_cache=refresh_cache,
        )
    
        effective_query = search_query or " ".join(part for part in [class_filter, member_filter] if part)
        query_text = _normalize_search_text(effective_query)
        query_tokens = set(_tokenize_search_text(effective_query))
        class_filter_lower = class_filter.lower()
        member_filter_lower = member_filter.lower()
    
        raw_results: list[tuple[int, dict[str, Any]]] = []
    
        for cls in docs_api.get("classes", []):
            if not isinstance(cls, dict):
                continue
    
            class_name_value = str(cls.get("name", "")).strip()
            if not class_name_value:
                continue
    
            class_name_lower = class_name_value.lower()
            class_exact = bool(class_filter and class_name_lower == class_filter_lower)
            class_partial = bool(class_filter and class_filter_lower in class_name_lower)
            if class_filter and not (class_exact or class_partial):
                continue
    
            class_brief = str(cls.get("brief_description", ""))
            class_description = str(cls.get("description", ""))
            class_score = _score_identifier(class_name_value, query_text, query_tokens)
            class_score += _score_description(class_brief, query_text, query_tokens)
            class_score += _score_description(class_description, query_text, query_tokens)
            if class_exact:
                class_score += 160
            elif class_partial:
                class_score += 60
    
            if kind_filter in {"any", "class"} and not member_filter:
                if class_score > 0 or class_exact:
                    raw_results.append(
                        (
                            class_score,
                            {
                                "kind": "class",
                                "class_name": class_name_value,
                                "inherits": cls.get("inherits"),
                                "signature": _format_match_signature("class", class_name_value, cls),
                                "brief_description": _compact_doc_text(class_brief, 180),
                                "description_snippet": _compact_doc_text(class_description),
                            },
                        )
                    )
    
            collections: list[tuple[str, list[dict[str, Any]]]] = []
            if kind_filter in {"any", "method"}:
                collections.append(("method", cls.get("methods", [])))
            if kind_filter in {"any", "property"}:
                collections.append(("property", cls.get("properties", [])))
            if kind_filter in {"any", "signal"}:
                collections.append(("signal", cls.get("signals", [])))
            if kind_filter in {"any", "constant"}:
                collections.append(("constant", cls.get("constants", [])))
    
            for kind, items in collections:
                if not isinstance(items, list):
                    continue
                for item in items:
                    if not isinstance(item, dict):
                        continue
    
                    item_name = str(item.get("name", "")).strip()
                    if not item_name:
                        continue
    
                    item_name_lower = item_name.lower()
                    member_exact = bool(member_filter and item_name_lower == member_filter_lower)
                    member_partial = bool(member_filter and member_filter_lower in item_name_lower)
                    if member_filter and not (member_exact or member_partial):
                        continue
    
                    item_description = str(item.get("description", ""))
                    score = _score_identifier(item_name, query_text, query_tokens)
                    score += _score_description(item_description, query_text, query_tokens)
                    if class_exact:
                        score += 40
                    elif class_partial:
                        score += 10
                    if member_exact:
                        score += 180
                    elif member_partial:
                        score += 70
    
                    if score <= 0 and not member_exact:
                        continue
    
                    raw_results.append(
                        (
                            score,
                            {
                                "kind": kind,
                                "class_name": class_name_value,
                                "name": item_name,
                                "signature": _format_match_signature(kind, class_name_value, item),
                                "description_snippet": _compact_doc_text(item_description),
                            },
                        )
                    )
    
        raw_results.sort(key=lambda item: (-item[0], item[1].get("kind", ""), item[1].get("class_name", ""), item[1].get("name", "")))
    
        unique_results: list[dict[str, Any]] = []
        seen: set[tuple[str, str, str]] = set()
        for score, result in raw_results:
            key = (
                str(result.get("kind", "")),
                str(result.get("class_name", "")),
                str(result.get("name", "")),
            )
            if key in seen:
                continue
            seen.add(key)
            result["score"] = score
            unique_results.append(result)
    
        return {
            "query": search_query or None,
            "class_name": class_filter or None,
            "member_name": member_filter or None,
            "member_type": kind_filter,
            "results": unique_results[:max_results],
            "total_matches": len(unique_results),
            "docs_cache_path": str(docs_path),
            "godot_executable": str(executable),
            "godot_version": version,
        }
  • Registration of the godot_search_docs tool within the server, linking the definition to the GodotController handler.
        name="godot_search_docs",
        description="Search the exact local Godot docs for the installed engine version, including class, method, property, signal, and constant docs.",
        input_schema={
            "type": "object",
            "properties": {
                "query": {
                    "type": "string",
                    "description": "Free-text query, such as 'add child node' or 'timer start one shot'.",
                },
                "class_name": {
                    "type": "string",
                    "description": "Optional class filter or exact class lookup, such as Node, Timer, Sprite2D, or CharacterBody3D.",
                },
                "member_name": {
                    "type": "string",
                    "description": "Optional member filter or exact member lookup, such as add_child, start, position, or ready.",
                },
                "member_type": {
                    "type": "string",
                    "description": "Optional result type filter: any, class, method, property, signal, or constant.",
                    "default": "any",
                },
                "max_results": {
                    "type": "integer",
                    "description": "Maximum number of matches to return.",
                    "default": 8,
                    "minimum": 1,
                },
                "refresh_cache": {
                    "type": "boolean",
                    "description": "Whether to rebuild the local docs cache from the selected Godot executable.",
                    "default": False,
                },
                "godot_executable": {
                    "type": "string",
                    "description": "Optional explicit path to the Godot executable or .app bundle.",
                },
            },
            "additionalProperties": False,
        },
        handler=lambda args: self.controller.search_docs(
            query=args.get("query"),
            class_name=args.get("class_name"),
            member_name=args.get("member_name"),
            member_type=args.get("member_type", "any"),
            max_results=int(args.get("max_results", 8)),
            refresh_cache=bool(args.get("refresh_cache", False)),
            godot_executable=args.get("godot_executable"),
        ),
    ),
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool searches, not how it behaves. It doesn't disclose whether this is a read-only operation, what happens when cache is refreshed, authentication requirements, rate limits, error conditions, or what the search results look like. The description adds minimal behavioral context beyond the basic function.

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?

Single sentence with zero waste, front-loaded with the core action. Every word contributes essential information: the action (search), scope (exact local Godot docs), version context (installed engine), and content types covered. No redundant or verbose phrasing.

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?

For a 7-parameter search tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the search returns, how results are ranked/formatted, error handling, or behavioral constraints. The description only covers the 'what' not the 'how' or 'what to expect,' leaving significant gaps for an agent to understand tool behavior.

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 7 parameters. The description mentions searching 'class, method, property, signal, and constant docs' which aligns with the member_type parameter values, but adds no additional semantic context beyond what's already in the parameter descriptions. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Search') and resource ('exact local Godot docs for the installed engine version'), with explicit scope including 'class, method, property, signal, and constant docs.' It distinguishes from all 22 sibling tools which involve project/scene operations, node manipulation, or execution tasks rather than documentation search.

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

Usage Guidelines3/5

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

The description implies usage context (searching Godot documentation) but provides no explicit guidance on when to use this tool versus alternatives. It doesn't mention prerequisites like needing Godot installed or compare with other documentation sources. Usage is implied by the tool's name and description scope rather than explicitly stated.

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/MhrnMhrn/godot-mcp'

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