Skip to main content
Glama
nkarasiak

QGIS MCP

by nkarasiak

Validate Expression

validate_expression
Read-only

Check if a QGIS expression is valid, identify parse errors, and list referenced column names. Optionally validate against specific layer fields.

Instructions

Validate a QGIS expression. Returns whether it's valid, any parse errors, and referenced column names. Optionally test against a layer's fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes
layer_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The annotations already indicate readOnlyHint=true, confirming it is non-destructive. The description adds value by disclosing that the tool returns parse errors and referenced column names, and optionally tests against a layer's fields. This goes beyond the annotations without contradiction.

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, front-loaded with the primary purpose. Every word is informative and there is no redundancy. It efficiently conveys the core action, outputs, and optional feature.

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?

For a simple validation tool with an output schema (not shown but context indicates its existence), the description adequately covers purpose and basic behavior. It could mention that 'expression' is required and that validation checks syntax, but the presence of an output schema likely compensates for return types.

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 schema has 0% description coverage, so the description must compensate. It hints that 'layer_id' is used for optional field testing ('Optionally test against a layer's fields'), but does not explicitly map parameters to their roles or explain the format/structure of the expression parameter. The parameter names are self-explanatory, but more detail would be helpful.

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 validates a QGIS expression and specifies the return elements (validity, errors, column names). It distinguishes itself from sibling tools, which are focused on layer management, editing, and project operations, by being a non-destructive validation function.

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?

No explicit guidance is provided on when to use this tool versus alternatives. While it is the only expression validation tool among siblings, the description does not state conditions for use, prerequisites (e.g., needing a layer for field testing), or when not to use it.

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/nkarasiak/qgis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server