Skip to main content
Glama

add_cast_node

Adds a Cast To node to a Blueprint graph, compiles the Blueprint, and returns the node with its pins for immediate wiring.

Instructions

Add an IMPURE Cast To node (exec in, Cast Succeeded / Cast Failed out) and compile the Blueprint. Same node as add_graph_node node_type="cast", which does NOT compile -- use that one inside a build_blueprint_graph batch. Skip the cast entirely when it only exists to type a GetComponentByClass result: add_get_component_by_class_node returns a ReturnValue pin already typed to the component class.

Returns: { node_id, class, title, pins:[...], blueprint_name, graph_name, cast_to } -- the node WITH its pins ('execute', 'Object', 'then'/Cast Succeeded, 'CastFailed', 'As'), so it can be wired without a follow-up read.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoOptional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk.
graph_nameNoTarget graph name; defaults to the Blueprint's event graph when omitted
position_xNoNode X position on the graph canvas (ignored when node_position is set)
position_yNoNode Y position on the graph canvas (ignored when node_position is set)
target_classNoAlias accepted instead of target_class_name (same meaning); one of the two is required.
node_positionNoNode canvas position as [x, y]; takes precedence over position_x/position_y
blueprint_nameNoName (or full object path) of the Blueprint.
blueprint_pathNoAlias of `blueprint_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `blueprint_name`.
target_class_nameNoClass to cast to: a name ("Pawn", "Character"), a /Script/Module.Class path, or a Blueprint generated-class path (/Game/Dir/BP_X.BP_X_C).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.2.0
    • removedInput schema / required
      Removed value: -[
      -  "target_class_name"
      -]
  2. First observedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare it is a non-readonly, non-destructive, non-idempotent mutation. The description adds important behavior beyond that: it compiles the Blueprint (a side effect distinct from the graph-node variant) and returns the node already carrying its pins so it can be wired without a follow-up read. It does not itself cover the PIE-refusal/disk-write behavior, but that is carried in the schema's force parameter, so this is a strong but not exhaustive disclosure.

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

Conciseness4/5

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

Front-loads what the node is and its compile side effect, then routes to alternatives, then documents the return shape. Dense but every sentence carries routing or return-value information; it is slightly long but not padded.

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?

There is no output schema, but the description enumerates the return fields (node_id, class, title, pins, blueprint_name, graph_name, cast_to) and the pin names, so an agent knows what comes back and can wire the node without a follow-up read. Combined with the schema and annotations, the definition is complete for this tool.

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 already documents every parameter (force, blueprint_name/path aliases, target_class vs target_class_name, positions). The description adds no parameter-level syntax or alias guidance, so the baseline 3 applies.

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?

States a specific verb (add) and resource (an IMPURE Cast To <Class> node) and names two sibling tools it must be told apart from (add_graph_node node_type="cast", add_get_component_by_class_node). An agent can distinguish this tool from its neighbors without opening any schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use and when-not-to-use guidance: use add_graph_node node_type="cast" inside a build_blueprint_graph batch (it does not compile), and skip the cast entirely when it only exists to type a GetComponentByClass result. Alternatives and the selecting conditions are stated, not implied.

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

Deploy Server

Other Tools