Skip to main content
Glama

add_niagara_event_handler

Idempotent

Add an event handler to a Niagara emitter to consume a source event, create its event script, and persist it without duplicate handlers.

Instructions

Add an event handler to a Niagara emitter (the writer for event_handler_count). Constructs an FNiagaraEventScriptProperties (allocating its UNiagaraScript with usage ParticleEventScript, mirroring add_niagara_simulation_stage) and adds it via UNiagaraEmitter::AddEventHandler. Idempotent by source_event_name: if a handler for that event already exists it is returned (already_exists=true) without adding a duplicate. The system is saved after modification. The handler's event-script graph is created in a default state — full event wiring must be completed in the Niagara editor (reported honestly via note); the handler properties are persisted and re-readable.

Returns: { system_path: string, emitter_name: string, usage_id: string, source_event_name: string, execution_mode: string, spawn_number: int, max_events_per_frame: int, already_exists: bool, event_handler_count: int, saved: bool, save_error?: string, note: string }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
system_pathYesAsset path of the Niagara System (e.g. "/Game/Niagara/NS_Example").
emitter_nameYesDisplay name of the emitter handle within the system.
spawn_numberNoOptional int particles to spawn per event (SpawnedParticles mode).
execution_modeNoOptional EveryParticle | SpawnedParticles | SingleParticle (default EveryParticle).
min_spawn_numberNoOptional int minimum spawn when random_spawn_number is set.
source_emitter_idNoOptional GUID of the emitter handle that generates the event (default: this emitter).
source_event_nameYesName of the source event this handler consumes (its identity key for idempotency).
random_spawn_numberNoOptional bool: spawn a random count in [min_spawn_number, spawn_number].
max_events_per_frameNoOptional int cap on events consumed per frame.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.2.0
    • changedInput schema / required
      Previous value: -[
      -  "emitter_name",
      -  "source_event_name"
      -]New value: +[
      +  "system_path",
      +  "emitter_name",
      +  "source_event_name"
      +]
  2. First observedv1.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, yet the description adds substantial context: idempotency keyed on source_event_name with an already_exists return, that the system is saved after modification, and crucially that the event-script graph is left in a default state requiring manual editor wiring. That 'reported honestly via note' disclosure is exactly the kind of caveat an agent needs.

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-loaded with the action and its data meaning, then behavior, then the returns object. It is dense but every clause carries signal; the full Returns enumeration is long but justified because no output schema exists.

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?

For a 9-param mutation tool with no output schema, the description supplies the return shape inline plus idempotency, save behavior, and the partial-completion caveat. Nothing an agent needs to invoke or interpret the result is missing.

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 baseline is 3 and the schema already documents all nine parameters including their optionality and defaults. The description only reinforces source_event_name as the idempotency identity key and does not add syntax beyond the schema.

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+resource ('Add an event handler to a Niagara emitter') and immediately ties it to its data field ('the writer for event_handler_count'). It also names the internal construction (FNiagaraEventScriptProperties, AddEventHandler) and the sibling it mirrors (add_niagara_simulation_stage), so an agent can distinguish it from remove_niagara_event_handler and get_niagara_event_handlers.

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 (add a handler consuming a source event) and signals the mirror relationship with add_niagara_simulation_stage, but it never states explicit when-to-use vs alternatives or exclusions. The editor-wiring caveat is context, not routing guidance.

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