Skip to main content
Glama

add_layer

Adds or replaces a thematic QGIS layer styled from the catalog, with automatic field detection, clipping, and legend titles.

Instructions

Add (or replace) a thematic layer, styled from the catalog.

In QGIS it appears in the "Capas temáticas" group, in drawing order.

Args: layer_type: Key from list_layer_types, e.g. "zonas_vida", "rios", "volcanes". path: Vector or raster file with the data. field: Attribute used to classify colors (auto-detected when omitted). label_field: Attribute used for labels (auto-detected when omitted). clip: "shape" cuts to the project polygon, "extent" to the map frame, "none" keeps the layer whole. Defaults depend on the layer type. title: Legend title (defaults to the catalog title). subset: Optional attribute filter in QGIS expression syntax.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clipNo
pathYes
fieldNo
titleNo
subsetNo
layer_typeYes
label_fieldNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses overwrite semantics ('or replace'), the visual grouping/drawing order, and the meaning of each clip mode; however it omits error behavior, whether the source file must be local/readable, and side effects on project/map state.

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?

Front-loaded opening sentence states the action and placement, then shifts to a per-argument list where each line earns its place. Slightly list-heavy but no filler or repetition.

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?

For a 7-parameter mutation tool with zero annotations and no output schema, the parameter documentation is solid, but the description stops short of describing failure modes, persistence of the added layer, or what the agent should expect afterward.

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 0%, so the description must compensate, and it does: all seven parameters are explained, including the clip enum values ('shape' cuts to project polygon, 'extent' to map frame, 'none' keeps whole) and auto-detection behavior for field/label_field. Only 'path' is thin, lacking format or path-style guidance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource ('Add (or replace) a thematic layer, styled from the catalog') and adds concrete placement detail ('Capas temáticas' group, in drawing order). It is distinguishable from list_layer_types and remove_layer, but never explicitly names those siblings as boundaries.

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?

It establishes a prerequisite workflow by stating layer_type is a 'Key from list_layer_types', which tells the agent to enumerate types first. It gives clear usage context but no explicit when-not-to-use guidance (e.g., versus set_project_area or generate_map).

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