Skip to main content
Glama

Recommend a design pattern for intent

card_builder_design_for_intent
Read-onlyIdempotent

Convert a free-text card request into a concrete Home Assistant design pattern by scoring curated patterns and returning the best match plus alternatives.

Instructions

Score curated design patterns against a free-text intent and recommend the top match.

Scores each entry in DESIGN_PATTERNS by domain match (weight 5) and intent-keyword overlap (weight 1.5 per hit against intent.lower()), then returns the top scorer plus up to three runners-up; makes no call to Home Assistant.

Use when: turning a user's free-text card request into a concrete pattern/template recommendation. Not for: the full pattern body — call card_builder_get_design_pattern(name) on the recommendation; the underlying design rules — call card_builder_design_principles. Returns: {intent, domain, entity_id, recommendation, score, label, description, ux_notes, recommended_template, anti_patterns, next_steps, alternatives}, or {..., "recommendation": None, "note": ...} when nothing scores above zero.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNoHA entity domain to weight the match toward, e.g. 'sensor'. Omit to infer from entity_id or match on keywords alone.
intentYesFree-text description of what the card should do, e.g. 'show battery level'.
entity_idNoFull entity id, e.g. 'sensor.battery'; used to infer domain when domain is omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.25.1
    • addedInput schema / properties / domain / description
      Added value: +"HA entity domain to weight the match toward, e.g. 'sensor'. Omit to infer from entity_id or match on keywords alone."
    • addedInput schema / properties / entity_id / description
      Added value: +"Full entity id, e.g. 'sensor.battery'; used to infer domain when domain is omitted."
    • addedInput schema / properties / intent / description
      Added value: +"Free-text description of what the card should do, e.g. 'show battery level'."
  2. Addedv0.18.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, closed-world behavior, but the description goes further by disclosing the scoring algorithm (domain weight 5, keyword overlap 1.5), the fact that no Home Assistant call is made, and the zero-score edge case returning recommendation: None. The remaining gap is the ranking of runners-up (says 'up to three' but not ordering or tie-breaking).

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?

Strongly front-loaded: purpose first, then mechanics, then use/not-for routing, then return shape. The scoring-weight sentence and the enumerated return keys are dense but each earns its place; the lengthy return list is the only mild redundancy given an output schema exists.

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?

For a recommendation tool with 3 params, annotations, and a full output schema, the description covers trigger, alternatives, follow-up actions, and failure mode. It is slightly over-complete in restating the return object, and it does not explain how alternatives are ordered or truncated, but nothing essential for invocation 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 the baseline is 3, but the description adds real meaning beyond the schema by explaining how each parameter influences scoring (domain match weighted at 5, intent keyword hits at 1.5 against intent.lower()) and that entity_id is used to infer domain. That is more than the schema's static field descriptions.

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 states a specific verb (score/recommend) and resource (curated design patterns) and immediately differentiates itself from siblings by naming card_builder_get_design_pattern and card_builder_design_principles. An agent can route correctly without opening any 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?

Explicit 'Use when' clause defines the trigger (free-text card request -> pattern recommendation), and 'Not for' names both alternatives plus the exact follow-up call to make with the returned recommendation. When-to-use and when-not-to-use are both covered.

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