Skip to main content
Glama

style_set_rule_based

Apply rule-based symbology to a vector layer by defining rules with QGIS expressions, colors, and labels; features use the first matching rule, with an empty expression as a catch-all.

Instructions

Style a vector layer with rule-based symbology.

rules is a list of {"expression", "color", "label"} - each feature is styled by the first rule whose QGIS expression matches. Use an empty string expression for a catch-all/ELSE rule.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rulesYes
layer_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses the rule evaluation order ('first matching rule') and catch-all usage, which is helpful. However, it omits critical behavioral details: whether the tool replaces existing styles, if it requires an editable layer, or what happens if the layer_id is invalid. It does not mention if the operation is undoable or if it triggers a refresh.

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?

The description is extremely concise: two short paragraphs totaling three sentences. The purpose is front-loaded in the first sentence. Every sentence adds unique value, with no redundant or filler content. It efficiently conveys the core purpose, rule structure, and special behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given moderate complexity of rule-based styling and lack of annotations, the description covers the essential input structure and evaluation logic. However, it lacks completeness in several areas: no explanation of output (though output schema exists), no mention of prerequisites (layer must exist, be vector), and no disclosure of side effects (whether existing style is replaced). An output schema exists but is not referenced; the agent must infer behavior from the name and sibling tools.

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 description coverage is 0%, so the description must compensate. It explains the structure of the 'rules' parameter (list of objects with expression, color, label) and the evaluation logic (first match, empty string for catch-all). This adds significant meaning beyond the bare schema. However, it does not specify the format of 'expression' (e.g., QGIS expression syntax) or 'color' (e.g., hex, RGB), which are important for correct invocation.

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 clearly states the tool's purpose: 'Style a vector layer with rule-based symbology.' It distinguishes from sibling styling tools (e.g., style_set_single_symbol, style_set_categorized) by explicitly naming the method. The explanation of the rules parameter further clarifies the function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like style_set_categorized or style_set_graduated. It does not state prerequisites (e.g., layer must be loaded, editable) or exclusions. The agent is left to infer usage context from the tool name alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piatkowski/qgis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server