Skip to main content
Glama

Spawn an entity

ent_spawn

Creates a frozen or physics-enabled entity in the server realm, setting class, model, position, angles and keyvalues before spawning. Use it to place props or NPCs on a loaded map.

Instructions

Creates an entity in the server realm, in this order: ents.Create(class), SetModel, SetPos, SetAngles, SetKeyValue for each keyvalue (values sent as strings), Spawn, Activate, then freeze. It stays until removed or the map changes. Result: the entity summary {id, class, model, name, pos, ang}. Error invalid_class if the class does not exist. Example: {"class": "prop_physics", "model": "models/props_c17/oildrum001.mdl", "pos": [0, 0, 100], "freeze": true}. Needs a loaded map (map_load): the server and client realms do not exist at the main menu.

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": {
      "class": "<class>"
    },
    "name": "ent_spawn"
  }
}

Input Schema

NameRequiredDescriptionDefault
angNoAngles [pitch, yaw, roll] in degrees.
posNoPosition, [x, y, z] in Hammer units (default: the origin).
classYesEntity class, e.g. prop_physics, npc_citizen.
modelNoModel path, e.g. models/props_c17/oildrum001.mdl.
freezeNoDisable physics motion after spawning (default false).
instanceNoOptional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance.
keyvaluesNoMap keyvalues set before Spawn, e.g. {"targetname": "test"}.

Output Schema

NameRequiredDescriptionDefault
idNo
angNo
posNo
nameNo
nextNo
nickNo
noteNo
classNo
modelNo
warningNo
distanceNo
next_callNo
answered_byNo
truncated_noteNo
version_warningNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only cover openWorldHint=false and destructiveHint=false; the description adds real behavioral context beyond that: ordered engine call sequence, keyvalues coerced to strings, freeze applied after Activate, entity persistence across map changes, the error code invalid_class, and the realm requirement. That is substantive disclosure for a mutation tool.

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 creation order is front-loaded and each sentence carries distinct information (pipeline, lifetime, result, error, example, prerequisite). It is dense and somewhat run-on with nested parentheticals, but no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

A mutation tool with an output schema and 7 params is well served: prerequisite, error case, side effects and lifetime are all covered, and the return summary is mentioned although the output schema already defines it. Minor redundancy and the unaddressed instance-relay edge case keep it from 5.

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 coverage is 100% so the baseline is 3, but the description adds meaning the schema lacks: keyvalue values are sent as strings, freeze happens after the spawn pipeline completes, and a full worked example shows how class/model/pos/freeze combine. It does not clarify ang ordering or instance relay beyond schema text.

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 ('Creates an entity in the server realm') and then enumerates the exact engine call sequence (ents.Create, SetModel, SetPos, Spawn, Activate, freeze). This is far more specific than the sibling names ents_find/ent_remove/ent_fire, which read/write/remove entities rather than creating them.

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?

Explicitly states the prerequisite ('Needs a loaded map (map_load): the server and client realms do not exist at the main menu') and the lifetime ('stays until removed or the map changes'), which points at removal. It does not name a removal tool or state when-not-to-use, so usage guidance is clear but not fully closed.

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