Skip to main content
Glama

select_features_by_expression

Select features in a QGIS layer by applying an expression (e.g., 'pop' > 1000). Control how the selection combines with existing selections using modes like set, add, intersect, or remove.

Instructions

Select features on a layer matching a QGIS expression, e.g. "pop" > 1000.

mode controls how the match combines with any existing selection: "set" (replace, default), "add", "intersect", or "remove". Returns the total selected count and a preview of matched feature ids (capped; the count is always exact even when the id list is truncated).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoset
expressionYes
layer_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations provided, the description has full responsibility for behavioral disclosure. It describes the return values (count and preview of feature ids) and the effect of different 'modes' on existing selection. However, it does not state whether the tool is read-only or if it modifies the layer permanently, leaving some ambiguity.

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?

The description is brief, consisting of two sentences that convey essential information. It is well-structured with a clear separation between the general purpose and the parameter behavior. There is no extraneous content, but a slightly more structured format could improve readability.

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?

The description covers the main aspects: purpose, parameters, and return values. However, given the existence of an output schema (implied by context signals), the description could rely on it for return details but instead provides them, which is good. Still, it lacks comparison with siblings and fails to mention edge cases or limitations.

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?

The input schema has 0% description coverage, so the description must compensate. It thoroughly explains the 'mode' parameter and provides an example for 'expression', but 'layer_name' is not described. This gives partial coverage but leaves one parameter without additional semantics.

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 clearly states it selects features based on a QGIS expression, specifying the verb 'select' and the resource 'features on a layer'. However, it does not differentiate from the sibling tool 'filter_layer_by_expression', which may have similar functionality, leading to potential confusion.

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

Usage Guidelines3/5

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

The description provides an example expression and explains the 'mode' parameter in detail, which helps in usage. However, it does not offer explicit guidance on when to use this tool over alternatives like 'filter_layer_by_expression' or mention prerequisites.

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