Skip to main content
Glama

add_input_trigger

Append Down, Pressed, Released, Hold, Tap, Pulse, or ChordAction triggers to a key mapping or InputAction asset, defining exactly when a key fires its action.

Instructions

Decide WHEN a key fires its action: append a trigger (Down / Pressed / Released / Hold / Tap / Pulse / ChordAction) so a key can mean tap-to-do-X and hold-to-do-Y instead of consuming two keys. Targets either one key mapping inside a mapping context (pass context + key) or, with no context and no key, the InputAction asset's own Triggers array -- the difference decides whether the rule applies to that binding or to the action everywhere, so a key without a context is refused rather than read as the action. The edited asset is saved, and the call succeeds only when it reaches disk. Tune it afterwards with set_input_action_trigger_behavior; list_input_trigger_types enumerates the classes.

Returns: Context target: { context_name, action_name, key, trigger_type, trigger_class, index, trigger_count, saved, save_error? }; Action target: { action_name, action_path, trigger_type, trigger_class, index, trigger_count, saved, save_error? }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoKey name of the mapping the trigger is attached to: required with a context, and refused when there is no context.
key_nameNoInput key name (e.g. SpaceBar, Gamepad_FaceButton_Bottom)
action_nameNoShort asset name of the InputAction.
action_pathNoAsset path of the Input Action
context_nameNoShort asset name of the InputMappingContext. Omit it (and context_path) to append the trigger to the InputAction asset's own Triggers array instead of one of its key mappings.
context_pathNoAsset path of the Input Mapping Context, instead of context_name.
trigger_typeYesOne of "Down", "Pressed", "Released", "Hold", "Tap", "Pulse", "ChordAction".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.2.0
    • changedInput schema / properties / context_name / description
      Previous value: -"Short asset name of the InputMappingContext."New value: +"Short asset name of the InputMappingContext. Omit it (and context_path) to append the trigger to the InputAction asset's own Triggers array instead of one of its key mappings."
    • changedInput schema / properties / context_path / description
      Previous value: -"Asset path of the Input Mapping Context. When omitted (with no key), the trigger is appended to the InputAction asset's own Triggers array instead of a context mapping."New value: +"Asset path of the Input Mapping Context, instead of context_name."
    • changedInput schema / properties / key / description
      Previous value: -"Key name of the mapping the trigger is attached to."New value: +"Key name of the mapping the trigger is attached to: required with a context, and refused when there is no context."
    • changedInput schema / required
      Previous value: -[
      -  "context_name",
      -  "action_name",
      -  "key"
      -]New value: +[
      +  "trigger_type"
      +]
  2. First observedv1.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare a non-read-only, non-destructive mutation, and the description adds real behavioral context beyond them: the asset is written to disk and the call succeeds only when persisted, a key without a context is refused rather than reinterpreted, and the response carries a save_error field. It stops short of covering duplicate/ordering semantics, but this is well above the annotation baseline.

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?

The content is dense but front-loaded: the when-to-use framing and targeting rule come before the save/follow-up and return details. It is one long paragraph, which blurs the Returns section, but essentially every sentence carries distinct information.

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?

With no output schema, the description supplies the return shape for both target modes and the save_error variant, plus persistence and refusal semantics. For a seven-parameter mutation tool this is enough for an agent to call it correctly and interpret the result.

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 all seven parameters, including the context/key coupling. The description reinforces that coupling and adds the meaning of the two targeting modes, but that meaning largely restates the context_name and key schema descriptions, 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?

The description states a specific verb and resource ('append a trigger' to an input key/action) and goes further by disambiguating the two targeting modes (context+key vs the action's own Triggers array). It names the relevant siblings (set_input_action_trigger_behavior, list_input_trigger_types), so an agent can place it in the Input workflow without opening a 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 a clear motivating use case (tap-to-do-X and hold-to-do-Y instead of consuming two keys) and explains the routing condition that selects the context target versus the action target. It does not, however, say when to prefer a trigger over a sibling like add_input_modifier, so the alternative-path guidance is slightly incomplete.

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