Skip to main content
Glama

Create or update an NPC template

dos2_put_npc_template
DestructiveIdempotent

Create or update a saved NPC template in a GM campaign by copying and adjusting a base NPC's stats, skills, and items; omitted fields keep the base values.

Instructions

Creates a saved NPC template in the campaign (the Game Master's "Creatures and Items" panel), or changes the one that already has this name. The usual way is to copy a ready NPC with base and adjust it: name, level, alignment, GM stat edits, skills, items. Parameters you omit keep the base's values.

Writes Eggs.lsf. The previous file is backed up first; undo with dos2_restore. Fails with an error while the game process is running unless allow_running=true.
The template only defines what the GM can place: it does not put a character into a scene (place it in the game,
or use dos2_live_spawn). Returns created (true for a new template), the resulting template in full and the
backup id. For item templates use dos2_put_item_template.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "campaign": "<campaign>",
      "name": "<name>"
    },
    "name": "dos2_put_npc_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseNoTemplate to copy from: "Campaign:Name", or just a name that is unique across all campaigns (find one with dos2_find_templates). Omit to change the existing template called name in place.
nameYesTemplate name. An existing template with this name in the campaign is updated or replaced.
bonusNoGM additions to the base stats, e.g. {"Constitution": 4, "Strength": 2}. A value of 0 removes that edit.
itemsNoThe complete item list; replaces the items. Each entry: {"stats_id", "template_id", "amount", "slot", "level", "name"}. slot is a number or one of weapon, shield, helmet, breast, leggings, boots, gloves, belt, amulet, ring, ring2; backpack when omitted.
levelNoNPC level. Omit to keep the base's.
skillsNoThe complete skill list, e.g. ["Target_SingleHandedAttack", "Shout_EnemyTaunt"]. Replaces the skills and fills the skill bar in this order.
traderNoWhether the NPC offers trade. Omit to keep.
talentsNoTalents to add, by their Script Extender names, e.g. ["Executioner", "Leech"].
campaignYesThe campaign to work on: its name, its folder name, its UUID, or a unique part of any of them. dos2_status lists the campaigns.
alignmentNoAttitude towards the party: "Neutral NPC", "Evil NPC" (hostile) or "Good NPC" (ally).
archetypeNoAI archetype name that drives combat behaviour, copied verbatim into the template. Omit to keep.
stat_nameNoStats entry that gives the base stats, e.g. GEN_HumanCitizen. Omit to keep the base's.
items_fromNo"Campaign:Name" of a template whose items are copied as they are, including generated stats.
reset_bonusNoFirst drop every GM edit inherited from the base (stats, abilities, talents), then apply yours. Default false.
template_idNoRoot template GUID: the model, race and gender. Omit to keep the base's.
display_nameNoName shown above the character's head, when it should differ from the template name.
ability_bonusNoGM additions to abilities, e.g. {"TwoHanded": 3, "WarriorLore": 2}. 0 removes the edit.
allow_runningNoKeep false. Set true only after the user has confirmed that the running game sits in the main menu: a write into a campaign that is loaded in the game gets lost or damages it.
remove_talentsNoTalents to remove, by the same names.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed19 schema fields changedv0.1.1
    • addedInput schema / properties / ability_bonus / description
      Added value: +"GM additions to abilities, e.g. {\"TwoHanded\": 3, \"WarriorLore\": 2}. 0 removes the edit."
    • addedInput schema / properties / alignment / description
      Added value: +"Attitude towards the party: \"Neutral NPC\", \"Evil NPC\" (hostile) or \"Good NPC\" (ally)."
    • addedInput schema / properties / allow_running / description
      Added value: +"Keep false. Set true only after the user has confirmed that the running game sits in the main menu: a write into a campaign that is loaded in the game gets lost or damages it."
    • addedInput schema / properties / archetype / description
      Added value: +"AI archetype name that drives combat behaviour, copied verbatim into the template. Omit to keep."
    • addedInput schema / properties / base / description
      Added value: +"Template to copy from: \"Campaign:Name\", or just a name that is unique across all campaigns (find one with dos2_find_templates). Omit to change the existing template called name in place."
    • addedInput schema / properties / bonus / description
      Added value: +"GM additions to the base stats, e.g. {\"Constitution\": 4, \"Strength\": 2}. A value of 0 removes that edit."
    • addedInput schema / properties / campaign / description
      Added value: +"The campaign to work on: its name, its folder name, its UUID, or a unique part of any of them. dos2_status lists the campaigns."
    • addedInput schema / properties / display_name / description
      Added value: +"Name shown above the character's head, when it should differ from the template name."
    • addedInput schema / properties / items / description
      Added value: +"The complete item list; replaces the items. Each entry: {\"stats_id\", \"template_id\", \"amount\", \"slot\", \"level\", \"name\"}. slot is a number or one of weapon, shield, helmet, breast, leggings, boots, gloves, belt, amulet, ring, ring2; backpack when omitted."
    • addedInput schema / properties / items_from / description
      Added value: +"\"Campaign:Name\" of a template whose items are copied as they are, including generated stats."
    • addedInput schema / properties / level / description
      Added value: +"NPC level. Omit to keep the base's."
    • addedInput schema / properties / name / description
      Added value: +"Template name. An existing template with this name in the campaign is updated or replaced."
    • addedInput schema / properties / remove_talents / description
      Added value: +"Talents to remove, by the same names."
    • addedInput schema / properties / reset_bonus / description
      Added value: +"First drop every GM edit inherited from the base (stats, abilities, talents), then apply yours. Default false."
    • addedInput schema / properties / skills / description
      Added value: +"The complete skill list, e.g. [\"Target_SingleHandedAttack\", \"Shout_EnemyTaunt\"]. Replaces the skills and fills the skill bar in this order."
    • addedInput schema / properties / stat_name / description
      Added value: +"Stats entry that gives the base stats, e.g. GEN_HumanCitizen. Omit to keep the base's."
    • addedInput schema / properties / talents / description
      Added value: +"Talents to add, by their Script Extender names, e.g. [\"Executioner\", \"Leech\"]."
    • addedInput schema / properties / template_id / description
      Added value: +"Root template GUID: the model, race and gender. Omit to keep the base's."
    • addedInput schema / properties / trader / description
      Added value: +"Whether the NPC offers trade. Omit to keep."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: writes Eggs.lsf, backs up the previous file, supports undo via dos2_restore, and fails while the game is running unless allow_running=true. It also discloses the return values and that the template does not place a character into a scene.

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

Conciseness5/5

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

Front-loads the core create/update behavior, then side effects, constraints, return shape, and alternatives. It is dense but every sentence adds useful routing or safety information for a 19-parameter mutating tool.

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?

Completeness is strong for a complex mutation with no output schema: it names side effects, backup/undo behavior, runtime constraints, return fields, and sibling alternatives. Little relevant context for correct invocation 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 coverage is 100%, and the schema already documents all 19 parameters in detail. The description reinforces the key cross-parameter rule that omitted fields inherit the base's values, but it adds little per-parameter syntax beyond what the schema provides, so baseline 3 is appropriate.

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 the specific verb and resource: creates or updates a saved NPC template in a campaign. It distinguishes the tool from scene placement via dos2_live_spawn and from item templates via dos2_put_item_template, so an agent can identify its role without opening the 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?

Explains the usual workflow of copying a base NPC and adjusting fields, plus the fallback for changing an existing template in place. It also tells when to use dos2_restore and dos2_put_item_template, giving clear routing alternatives.

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