Skip to main content
Glama
nkarasiak

QGIS MCP

by nkarasiak

Get Layer Features

get_layer_features
Read-only

Fetch features from a QGIS vector layer using expression filters and pagination. Optionally include geometry, and get matched counts and attributes.

Instructions

Get features from a vector layer. Flat dicts: _fid + attributes at top level. expression filter (QGIS, e.g. "name = 'Berlin'", "population > 1000000"), limit (max 50, larger is refused; default 10), offset for paging, optional geometry in _geometry key. feature_count is the layer total; matched is the count after the expression filter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
layer_idYes
expressionNo
include_geometryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.5.0
    • removedInput schema / properties / expression / title
      Removed value: -"Expression"
    • removedInput schema / properties / include_geometry / title
      Removed value: -"Include Geometry"
    • removedInput schema / properties / layer_id / title
      Removed value: -"Layer Id"
    • removedInput schema / properties / limit / title
      Removed value: -"Limit"
    • removedInput schema / properties / offset / title
      Removed value: -"Offset"
    • removedInput schema / title
      Removed value: -"get_layer_featuresArguments"
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses concrete behavioral details: flat dicts with _fid and top-level attributes, limit enforcement (max 50, larger refused), default 10, offset paging, optional geometry under _geometry, and the distinction between feature_count and matched. This is rich, useful transparency.

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 compact and front-loaded, opening with the core action and then packing essential behavioral constraints into a few sentences. Each clause adds information about output format, filter syntax, paging, limits, or return counts without 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?

The description covers input semantics, output shape, filtering, paging, geometry handling, and count semantics. Since an output schema existschers, return format details are already structurally defined, and the description still adds valuable field-level and count-level context. This is complete for an agent to invoke the tool correctly.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining limit's max/default and refusal behavior, offset's paging role, expression's QGIS filter syntax with examples, include_geometry's effect, and the meaning of feature_count and matched. Every parameter except layer_id is meaningfully documented; layer_id is obvious from the resource context.

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 states a specific verb ('Get'), a clear resource ('features from a vector layer'), and differentiates this from sibling get_* tools like get_layer_extent or get_layers. It also communicates the exact output shape, making the tool's purpose unmistakable.

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 implies the tool is for retrieving features from vector layers with optional filtering and paging, but it does not explicitly say when to prefer this over alternatives like identify_features, select_features, execute_sql, or get_unique_values. No usage exclusions or comparison to sibling tools are provided.

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