Skip to main content
Glama

export_mesh_library

Destructive

Exports a scene's MeshInstance3D children as a MeshLibrary for GridMap use. Choose .tres (readable text) or .res (binary), and optionally limit which mesh items are exported.

Instructions

Export a scene's MeshInstance3D children as a MeshLibrary for GridMap. The outputPath extension sets the format: .tres is text (prefer it: readable, diffable), .res is binary. Not for 2D scenes. meshItemNames picks a subset, else all. Overwrites silently. Returns: outputPath, itemCount, itemNames read from the saved library; warnings leads when a requested name was not exported. Errors if no valid meshes, or while a runtime session is live.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectPath": "<projectPath>",
      "scenePath": "<scenePath>",
      "outputPath": "<outputPath>"
    },
    "name": "export_mesh_library"
  }
}

Input Schema

NameRequiredDescriptionDefault
scenePathYesScene file path relative to the project
outputPathYesOutput path for the MeshLibrary (relative to project). Its extension sets the format: .tres writes text, .res writes binary. Prefer .tres.
projectPathYesPath to the Godot project directory
meshItemNamesNoNames of specific mesh items to export. Omit to export all.

Output Schema

NameRequiredDescriptionDefault
warningsNo
itemCountYes
itemNamesYes
outputPathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.0.1
    • changedInput schema / properties / outputPath / description
      Previous value: -"Output path for the MeshLibrary .res file (relative to project)"New value: +"Output path for the MeshLibrary (relative to project). Its extension sets the format: .tres writes text, .res writes binary. Prefer .tres."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "itemCount": {
      +      "type": "number"
      +    },
      +    "itemNames": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "outputPath": {
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "outputPath",
      +    "itemCount",
      +    "itemNames"
      +  ],
      +  "type": "object"
      +}
  2. Addedv3.1.1
  3. Removedv3.0.0
  4. Addedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare destructiveHint=true, and the description earns credit by specifying exactly how that manifests ('Overwrites silently') plus two failure modes: no valid meshes, and a live runtime session. It stops short of stating whether the overwrite is atomic or whether the previous library is recoverable.

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?

Roughly five short sentences, front-loaded with purpose, then format selection, exclusions, mutation risk, and return shape. No filler and no repetition.

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

Completeness5/5

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

Even though an output schema exists, the description summarizes the return payload and explains that warnings lead when a requested name is missing, plus both error conditions. For a 4-parameter destructive tool this covers everything an agent needs to invoke it safely.

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 coverage is 100% and the schema already explains the extension-to-format mapping and the meshItemNames omission behavior, so the description largely restates it. The only additional meaning is that a requested name failing to export surfaces as a warning rather than an error, which is useful but marginal.

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 opens with a specific verb and resource ('Export a scene's MeshInstance3D children as a MeshLibrary for GridMap') and immediately scopes it against a downstream consumer. An agent knows exactly what the tool produces without opening the schema.

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

Usage Guidelines4/5

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

It gives an exclusion ('Not for 2D scenes'), a preference rule ('prefer .tres: readable, diffable'), and a fallback for the optional subset parameter ('meshItemNames picks a subset, else all'). What it lacks is any named alternative tool for the 2D or non-GridMap case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.