Skip to content
Browse documentation
DocsGEngine · Guides
4 min readView Markdown
This is the optional Unreal / GEngine reference. Compatibility depends on your plugin and editor versions. Check the version guide.

Context System

The unreal_get_ue_context tool solves a fundamental problem with AI-assisted Unreal development: language models have training cutoffs and often hallucinate deprecated or incorrect UE APIs. The context system injects accurate, version-pinned Unreal documentation directly into the AI's context window on demand.

The current documentation target is UE 5.8, hotfix 5.8.4. The installed plugin may contain an older context bundle. Check its version and compare signatures with the matching engine headers before applying generated code. A website documentation update does not update a local plugin bundle. See Unreal versions and upgrades.

The Problem

AI models trained before the installed engine release — or trained on a mix of UE versions — frequently:

  • Suggest APIs that were deprecated or removed in 5.x
  • Use incorrect function signatures (wrong parameter order, wrong types)
  • Confuse UE4 patterns with UE5 equivalents (e.g., GetWorld()->SpawnActor vs Enhanced Subsystems)
  • Generate UPROPERTY and UFUNCTION specifiers that do not exist in your engine version

These errors are subtle. The code often looks plausible and compiles after minor edits, but produces incorrect runtime behavior.

The Solution

unreal_get_ue_context is a read-only tool that fetches curated, version-pinned documentation snippets from the installed plugin bundle. When the AI calls this tool before writing code, it receives accurate API signatures, correct specifier lists, and working code examples — grounded in the version identified by that bundle.

Categories

The tool accepts a category string that selects a documentation domain. Available categories:

CategoryContents
actorAActor lifecycle, spawning, tags, components, tick, destroy
animationUAnimInstance, state machines, montages, notifies, linked layers
assetsAsset registry, FAssetData, UObjectLibrary, async loading
blueprintBlueprint-callable C++ patterns, UFUNCTION specifiers, BlueprintImplementableEvent
characterACharacter, UCharacterMovementComponent, movement modes, jump
enhanced_inputUInputAction, UInputMappingContext, UEnhancedInputComponent, triggers, modifiers
materialUMaterialInstanceDynamic, parameter collections, MID in C++
parallel_workflowsTask graph, AsyncTask, ParallelFor, game thread marshaling
replicationUPROPERTY replication, RPCs, OnRep, NetMulticast, authority checks
slateSWidget, SCompoundWidget, SLATE_ATTRIBUTE, FSlateApplication

How to Use

Call unreal_get_ue_context at the start of any task that involves writing Unreal C++. Pass the category most relevant to the work.

{
  "operation": "query",
  "params": {
    "category": "enhanced_input"
  }
}
{
  "operation": "query",
  "params": {
    "category": "character"
  }
}

The tool returns a structured documentation block that is injected into the AI's context window. The AI reads it before generating code, checking the returned version and signatures rather than relying on training data.

Example Response

Illustrative output for the enhanced_input category (inspect your installed bundle for its actual version and signatures):

Unreal Enhanced Input — Key APIs

UInputAction (UIA)
  Class:    UInputAction : UDataAsset
  Header:   EnhancedInput/Public/InputAction.h
  ValueType: EInputActionValueType { Boolean, Axis1D, Axis2D, Axis3D }

UInputMappingContext (IMC)
  Class:    UInputMappingContext : UDataAsset
  Header:   EnhancedInput/Public/InputMappingContext.h
  AddMapping: FEnhancedActionKeyMapping& AddMapping(UInputAction*, FKey)

Binding in C++ (APlayerController subclass):
  void AMyController::SetupInputComponent()
  {
      Super::SetupInputComponent();
      UEnhancedInputComponent* EIC =
          CastChecked<UEnhancedInputComponent>(InputComponent);
      EIC->BindAction(IA_Jump, ETriggerEvent::Triggered,
                      this, &AMyController::OnJump);
      // Add IMC
      if (UEnhancedInputLocalPlayerSubsystem* Sub =
          ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(
              GetLocalPlayer()))
      {
          Sub->AddMappingContext(IMC_Default, 0);
      }
  }

UPROPERTY specifiers for input assets:
  UPROPERTY(EditDefaultsOnly, Category="Input")
  TObjectPtr<UInputAction> IA_Jump;

  UPROPERTY(EditDefaultsOnly, Category="Input")
  TObjectPtr<UInputMappingContext> IMC_Default;

When to Use It

Use unreal_get_ue_context whenever the task involves:

  • Writing new C++ classes that extend UE engine classes
  • Using UE subsystems (Enhanced Input, GAS, Online Subsystem, etc.)
  • Adding UPROPERTY or UFUNCTION specifiers you're not certain about
  • Implementing replication — authority checks, RPCs, OnRep functions
  • Working with the animation system (montages, linked layers, notify states)
  • Using Slate for custom editor UI widgets

You do not need it for:

  • Pure Blueprint graph operations (use unreal_blueprints tool calls instead)
  • Reading or searching existing assets
  • Moving or spawning actors with known class paths

Context vs. Searching Engine Source

unreal_get_ue_context is faster and more reliable than reading engine source files directly:

ApproachSpeedAccuracyToken cost
unreal_get_ue_contextInstantCurated, version-pinnedLow — returns only relevant snippets
Reading engine source filesSlowExact but requires navigationHigh — full header files
Relying on training dataInstantUnreliable, may be outdatedZero

For most coding tasks, unreal_get_ue_context gives you the right answer in one call. Only reach for engine source files when you need implementation details that go beyond API signatures — for example, understanding the internal state machine of UCharacterMovementComponent.

Use the Engine/Source/ directory of your own installed or source-built editor. For the current target, verify against UE 5.8.4 rather than a different developer's checkout.

Need a hand with this workflow? Find help or contact support.