Evaluate Expression
evaluate_expressionEvaluate QGIS expressions to compute scalar values like aggregates, project variables, or dates. Optionally include a layer for context.
Instructions
Evaluate a standalone QGIS expression to a scalar value (e.g. aggregate('layer','sum','field'), @project_var, now()). Optional layer_id adds layer scope. Distinct from validate_expression (validate only) and field_calculator (per-feature).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expression": "<expression>"
},
"name": "evaluate_expression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer_id | No | ||
| expression | Yes |