Skip to main content
Glama

Find entities

ents_find
Read-only

Lists map entities filtered by class, model, or distance from a point, returning IDs, positions, and distances for inspection or targeting.

Instructions

Lists entities, filtered by class, model and/or distance (all filters combine; none = every entity). class and model are case-insensitive globs where * matches anything ("prop_*", "door", "models/props_c17/"). near + radius keep the entities whose position is within radius of near (ents.FindInSphere), sorted nearest first, each with distance. Result: {entities: [{id, class, model, name (targetname, if any), nick (players), pos [x,y,z], ang [p,y,r], distance?}], count (all matches), truncated (count > limit)}. id is the entity index: pass it to ent_info, ent_fire, ent_remove (a clientside-only entity, ClientsideModel and the like, has id -1: no tool can address it, see note; use lua_exec in the client realm). A number the game cannot hold (NaN, infinity) reads null. Server realm by default; the client realm only sees networked entities (and no targetnames). Example: {"class": "func_door", "near": [0, 0, 64], "radius": 1024, "limit": 10}. Needs a loaded map (map_load): the server and client realms do not exist at the main menu.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ents_find"
  }
}

Input Schema

NameRequiredDescriptionDefault
nearNoCenter of the search sphere, [x, y, z] in Hammer units.
classNoClass glob, case-insensitive, e.g. prop_physics or prop_*.
limitNoMax entities returned (default 100); count still counts all.
modelNoModel path glob, case-insensitive, e.g. *chair*.
realmNoRealm (default server).
radiusNoSphere radius in Hammer units, used with near (default 512).
instanceNoOptional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance.

Output Schema

NameRequiredDescriptionDefault
nextNo
noteNo
countYes
warningNo
entitiesYes
next_callNo
truncatedYes
answered_byNo
truncated_noteNo
version_warningNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover read-only and closed-world, yet the description supplies sorting order ('nearest first'), truncation semantics (count counts all matches, truncated when count > limit), the id -1 edge case, realm visibility differences (client sees only networked entities and no targetnames), NaN/infinity reading as null, and the map-load prerequisite.

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 and filters, then result shape, then edge cases and prerequisites; every sentence carries information. It is a dense run-on paragraph with heavy parenthetical nesting, which slightly hurts scanability.

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 7-parameter tool with no required parameters, the definition covers realm defaults, truncation, the identity field's downstream uses, non-addressable clientside entities, and the map-load precondition. Although an output schema exists, the brief result-shape note is a helpful convenience rather than filler.

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 each parameter is already documented; the description still adds the combination semantics of the filters, the case-insensitive glob syntax with concrete pattern examples, and the coupling of radius to near. The worked example further anchors how the parameters interact.

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?

Opens with a specific verb and resource ('Lists entities') and immediately scopes the filtering dimensions (class, model, distance). It is clearly distinguishable from ent_info (single entity by id) because the description explicitly names that sibling as a consumer of the returned id.

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?

States that all filters combine and that omitting them returns everything, gives the near+radius alternative for spatial queries, names ent_info/ent_fire/ent_remove as the follow-up tools for a returned id, and routes clientside-only entities (id -1) to lua_exec in the client realm. It also names the prerequisite (map_load, otherwise no realms exist).

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