Skip to main content
Glama

Search entities

search_entities
Read-onlyIdempotent

Fuzzy-rank Home Assistant entities by entity_id, friendly_name, and device_id to find the right entity when you only know a name fragment. Returns top matches with scores, dropping zero-score results.

Instructions

Fuzzy-rank entities by entity_id, friendly_name and device_id.

Scores every entity against query with substring match (score 1.0) or a sequence-similarity ratio, keeps only scores above 0, and returns the top limit matches sorted descending.

Use when: you don't know the exact entity_id and want a ranked guess from a name fragment. Returns: list of dicts (entity_id, friendly_name, state, device_id, score) up to limit entries. Limits: entities that score exactly 0 are dropped entirely, not just deprioritised.

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": {
      "query": "<query>"
    },
    "name": "search_entities"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of ranked results to return; defaults to 20.
queryYesSearch text to fuzzy-match against entity_id, friendly_name and device_id.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds real behavioral value beyond them: the scoring mechanism (substring gives 1.0, otherwise sequence-similarity ratio), descending sort, top-`limit` cut, and the non-obvious "Limits" caveat that zero-score entities are dropped entirely rather than deprioritised. It omits finer traits like case sensitivity, but the mutation/destructiveness ground is fully covered by annotations.

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 labelled Use when / Returns / Limits layout is front-loaded and scannable, and no sentence is filler. The Returns block slightly duplicates the output schema's field list, which is minor waste but also harmless orientation.

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?

An output schema exists, so the return-field enumeration is not strictly required, but the description supplies what the schema cannot: the ranking mechanism, cutoff semantics, and the dropped-zero-score edge case. For a two-parameter, low-risk read tool this is essentially complete; only matching-case behaviour is left unstated.

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 a baseline of 3 applies; the description earns above that by explaining how `query` is actually consumed (substring vs sequence-similarity over three specific fields) and that `limit` is a cap on the ranked list after zero-score filtering. This meaning is not recoverable from the schema strings alone.

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 opens with a specific verb and resource ("Fuzzy-rank entities") and names the three fields being matched (entity_id, friendly_name, device_id). The "Use when you don't know the exact entity_id" line implicitly separates it from exact-lookup siblings such as entities_get_entity, which live in the adjacent namespace.

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?

"Use when: you don't know the exact entity_id and want a ranked guess from a name fragment" gives a clear affirmative trigger and a rough alternative (exact ID -> exact lookup). It stops short of naming a specific alternative tool or stating a when-not condition, so it is clear context rather than full routing guidance.

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