Skip to main content
Glama

features_select_by_expression

Select features on a vector layer using QGIS expressions, with modes to set, add, intersect, or remove from existing selection.

Instructions

Select features on a vector layer using a QGIS expression.

mode controls how the match combines with the existing selection: "set" (default, replaces it), "add", "intersect", or "remove". Returns the resulting selected feature count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoset
layer_idYes
expressionYes

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 the full burden. It explains that mode controls how the match combines with the existing selection and that the return value is the count. However, it does not mention error handling (e.g., invalid expression) or performance implications.

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 very concise with two sentences. The first sentence states the core purpose, the second covers the crucial mode parameter and return value. No unnecessary words.

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 that there are three parameters and an output schema exists, the description covers the main behavior (selection via expression, mode, return count). However, it does not address error cases (e.g., what happens if expression fails or no features match) or the format of the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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 add meaning. It thoroughly explains the 'mode' parameter with its values and default. However, it does not describe 'layer_id' or 'expression' beyond their names, leaving the user to infer the latter is a QGIS expression string without examples.

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 'Select features on a vector layer using a QGIS expression.' This is a specific verb+resource+method, distinguishing it from siblings like features_select_by_rectangle and features_select_by_location which use geometric selection methods.

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 explains the mode parameter but does not provide guidance on when to use this tool versus alternatives (e.g., rectangle or location selection). It lacks prerequisites, such as the need for a valid QGIS expression or that the layer must be loaded.

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