Skip to main content
Glama

attributes_calculate

Calculate field values by evaluating QGIS expressions per feature, with optional filtering for targeted updates.

Instructions

Set a field's value from a QGIS expression, evaluated per feature (the field calculator).

Pass filter_expression to only update a subset of features; omit it to update every feature. This overwrites existing values on every matched feature - confirm with the user before running it on a layer that hasn't been backed up.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layer_idYes
expressionYes
field_nameYes
filter_expressionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations provided, so the description carries full burden. It discloses that it overwrites existing values on matched features and emphasizes a destructive nature. While it doesn't detail undoability or transactionality, it sufficiently warns about the behavior.

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?

Extremely concise: three sentences front-load the purpose, then add usage and warning. No wasted words, clearly structured.

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 output schema exists (noted in context), the description need not explain return values. It covers the main behavior, parameter, and important caveats. Could mention expression syntax, but overall adequate for the tool's simplicity.

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 coverage is 0%, so description must compensate. It explains filter_expression's optional behavior and default. However, layer_id, field_name, and expression are not described beyond their presence. The description adds some value for filter_expression but not fully covers all parameters.

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's purpose: 'Set a field's value from a QGIS expression, evaluated per feature (the field calculator).' This specific verb-resource combination distinguishes it from siblings like attributes_update_feature, which updates individual features rather than applying an expression to all.

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

Usage Guidelines5/5

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

Provides explicit guidance: pass filter_expression to update a subset, omit for all features. Also warns to confirm with user on non-backed-up layers. This helps the agent decide when to use and what precautions are needed.

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