Skip to main content
Glama

add_mapping_to_context

Bind a key to an InputAction in a saved Enhanced Input mapping context using short asset names instead of full paths. Returns the mapping index for adding triggers or modifiers.

Instructions

Bind a key to an InputAction in a saved Enhanced Input mapping context, addressing both by SHORT ASSET NAME (IMC_Foo / IA_Bar) instead of full paths -- otherwise the same operation as map_input_action, which takes paths. Returns the mapping index, which is what add_input_trigger / add_input_modifier / list_input_triggers address. A context that already maps that key to that action keeps its mapping (added false, already_mapped true, not saved); a new mapping succeeds only when the context reaches disk. Other actions on the same key are not checked: use find_free_input_key first.

Returns: { context_name, context_path, action_name, key, index, mapping_count, added, already_mapped, saved, save_error? }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoKey name to map (e.g. "SpaceBar", "W", "Gamepad_FaceButton_Bottom").
key_nameNoInput key name (e.g. SpaceBar, Gamepad_FaceButton_Bottom)
action_nameNoShort asset name of the InputAction (e.g. IA_Example).
action_pathNoAsset path of the Input Action
context_nameNoShort asset name of the InputMappingContext (e.g. IMC_Example).
context_pathNoAsset path of the Input Mapping Context

Schema Changelog

Changes observed during successful MCP inspections.

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

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover only the basic safety profile (not read-only, not destructive, not idempotent), so the description adds substantial context: an already-mapped pair is left unchanged (added false, already_mapped true) and not saved, a new mapping only succeeds once the context reaches disk, other actions on the same key are deliberately not checked, and a save_error field can appear. This is exactly the persistence/failure behavior an agent needs before calling.

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 purpose, then the differentiation, then return/side-effect semantics and a caveat — every clause carries information. It is dense and slightly long, with the inline Returns block partially duplicating the trailing Returns listing, so not perfectly tight.

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?

No output schema exists, so the description carries the return burden — and it does, enumerating context_name, context_path, action_name, key, index, mapping_count, added, already_mapped, saved and the optional save_error. Combined with the mutation and save semantics, an agent has everything needed to call and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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, but the description meaningfully adds that the *name* parameters take short asset names rather than paths — important because the schema exposes both name and path variants for action and context without saying which form is expected or that only one is used.

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 and resource ('Bind a key to an InputAction in a saved Enhanced Input mapping context') and immediately distinguishes itself from the sibling map_input_action by the short-asset-name (IMC_Foo / IA_Bar) addressing mode. An agent can pick this over map_input_action without opening either 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?

Explicitly names the alternative ('otherwise the same operation as map_input_action, which takes paths') and the condition that selects it, and routes the agent to find_free_input_key when other actions on the same key matter. It also tells the agent which follow-up tools consume the returned index (add_input_trigger / add_input_modifier / list_input_triggers).

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