Skip to main content
Glama

Search devices

search_devices
Read-onlyIdempotent

Fuzzy-search Home Assistant devices by partial name, manufacturer, or model to get ranked matches. Use when you need a device ID but don't know the exact identifier.

Instructions

Fuzzy-rank devices by name, name_by_user, manufacturer and model.

Scores every device from the device registry against query, keeps only scores above 0, and returns the top limit matches sorted descending.

Use when: you don't know a device's exact id and want a ranked guess from a name fragment. Not for: an exact, unranked device list — use devices_list_devices, areas_list_devices or devices_list_devices_in_area. Returns: list of dicts (id, name, name_by_user, manufacturer, model, area_id, score) up to limit entries. Limits: devices that score exactly 0 are dropped entirely; a WS failure yields an empty list rather than an error.

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_devices"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of ranked results to return; defaults to 20.
queryYesSearch text to fuzzy-match against a device's name, name_by_user, manufacturer and model.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.1

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, it discloses the scoring pipeline (zero-score devices dropped, top N sorted descending) and an important failure mode: a WS failure returns an empty list instead of an error. That silent-degradation behavior is exactly the kind of non-obvious trait an agent needs to interpret empty results correctly.

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-loaded with the core behavior, then organized into Use when / Not for / Returns / Limits. Every sentence carries distinct information; no restatement of the tool name or filler.

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 2-parameter read-only search with an output schema present, the description still covers mechanism, selection guidance, return shape and edge-case limits. Nothing an agent needs to call it or interpret its output is missing.

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 both parameters are already documented, but the description adds meaning the schema lacks: results are sorted descending by score and only non-zero matches survive, which clarifies how `limit` truncates the ranked list. Marginal value above the schema, but real.

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 ('Fuzzy-rank devices by name, name_by_user, manufacturer and model') and names the exact fields being matched. It also explicitly distinguishes itself from the unranked list siblings, so an agent can select it without opening another 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?

Has an explicit 'Use when' clause (unknown exact id, want a ranked guess from a name fragment) and an explicit 'Not for' clause naming three concrete alternatives for exact unranked listings. Both the selecting condition and the exclusions are stated outright.

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