Skip to main content
Glama

features_count

Count features in a vector layer, with optional QGIS expression filter for matching results.

Instructions

Count features on a vector layer, optionally matching a QGIS expression.

Without a filter this reads the provider's feature count directly (fast, no scan, same as project_list_layers); with a filter it scans and counts matches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layer_idYes
filter_expressionNo

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, the description bears full responsibility for behavioral transparency. It discloses the performance trade-off (fast provider count vs. scan) and the optional filter. However, it does not mention error conditions (e.g., invalid layer, invalid expression) or what the output looks like; the output schema may cover the latter.

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 two sentences with no wasted words. The first sentence states the core purpose and parameters, and the second adds important behavioral nuance. It is front-loaded and easy to parse.

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

Completeness4/5

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

Given the tool's simplicity and the presence of an output schema, the description covers the key aspects: input parameters, optional filter, and performance characteristics. It could mention the return type (e.g., integer) but that is likely in the output schema. Overall, it is sufficiently complete for an agent to use correctly.

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?

The schema has no descriptions for parameters (0% coverage), so the description adds essential meaning. It explains that layer_id refers to a vector layer and filter_expression is a QGIS expression. It also describes how the tool behaves differently based on whether a filter is provided, which goes beyond what the schema conveys.

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 counts features on a vector layer with an optional QGIS expression filter. It distinguishes from siblings by noting the fast path without filter (same as project_list_layers) and the scanning path with filter, differentiating it from features_get and attributes_statistics.

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?

The description provides clear context for when to use the tool: for fast counting without filter or filtered counting with scanning. It mentions equivalence to project_list_layers for unfiltered counts, offering a point of comparison. It does not explicitly list when not to use or provide alternative tools, but the guidance is sufficient for most scenarios.

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