Skip to main content
Glama

Get one style snippet

card_builder_get_style_snippet
Read-onlyIdempotent

Retrieve a single built-in style snippet wrapped in its target and container envelope, ready to assign directly to a block's styles. Skips manual style composition and Home Assistant calls.

Instructions

Fetch one built-in style snippet wrapped in the full target/container envelope.

Looks up name in STYLE_SNIPPETS and wraps it as {target: {containers: {container: <snippet>}}}; makes no call to Home Assistant.

Use when: assigning exactly one snippet to a block's styles without composing several via card_builder_build_styles. Returns: {<target>: {containers: {<container>: <snippet>}}} — ready to assign to a block's styles directly. Errors: {"error": "unknown_snippet", "name": ..., "known": [...]} when name isn't a known snippet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesSnippet name, e.g. 'card_padded', from card_builder_list_style_snippets.
targetNoStyle target key to wrap the snippet under, e.g. 'block' or 'state'. Defaults to 'block'.block
containerNoResponsive container to wrap the snippet under: 'desktop', 'tablet', or 'mobile'. Defaults to 'desktop'.desktop

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 / container / description
      Added value: +"Responsive container to wrap the snippet under: 'desktop', 'tablet', or 'mobile'. Defaults to 'desktop'."
    • addedInput schema / properties / name / description
      Added value: +"Snippet name, e.g. 'card_padded', from card_builder_list_style_snippets."
    • addedInput schema / properties / target / description
      Added value: +"Style target key to wrap the snippet under, e.g. 'block' or 'state'. Defaults to 'block'."
  2. Addedv0.18.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint false, and destructiveHint false, so the safety profile is covered. The description adds rich context beyond annotations: it is a pure lookup that makes no Home Assistant call, never mutates state, and documents the exact error shape on failure. It also describes the return envelope precisely.

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 action and transformation in the first sentence, then structured sections for use when, returns, and errors. Every sentence earns its place with no redundancy.

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?

Given an output schema exists, the description needn't explain return values but still provides the exact envelope shape for direct assignment. It documents error behavior, confirms no HA call, and covers the single required parameter. Complete for a simple lookup tool.

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 schema already documents all three parameters including defaults and examples. The description reinforces the name lookup (STYLE_SNIPPETS) and the wrapping behavior of target/container beyond what the schema provides. However, it does not add syntax or format details for target/container values that the schema lacks.

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 (Fetch) and resource (one built-in style snippet), plus the exact transformation applied (wrapping in target/container envelope). It names the sibling it differs from (card_builder_build_styles) and clarifies it makes no Home Assistant call, distinguishing it from other card_builder siblings.

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 when-to-use: assigning exactly one snippet to a block's styles without composing several via card_builder_build_styles. The alternative is named and the condition that selects it is made explicit.

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