Skip to main content
Glama
awheeler262
by awheeler262

Execute SQL

execute_sql

Execute SQL queries across loaded QGIS layers to filter, join, or create new spatial layers. Results can be added as a new layer with geometry or returned inline as rows.

Instructions

SQL across loaded layers via a virtual layer; reference layers by name in FROM/JOIN. as_layer=True registers the result as a new layer (set geometry_field for spatial output); else returns rows inline (max 1000). layers limits sources by layer id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
layersNo
as_layerNo
uid_fieldNo
layer_nameNosql_result
geometry_fieldNo
Behavior3/5

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

The description discloses that results are limited to max 1000 rows inline and as_layer registers a new layer with optional geometry_field. However, it does not clarify if the tool is read-only, what happens on errors, or permissions needed. Since no annotations exist, the description carries full burden but leaves gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences, front-loading the core purpose. It could be better structured with bullet points for parameters, but the density is acceptable given the tool's complexity.

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

Completeness2/5

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

With 6 parameters, no schema descriptions, and no output schema, the description is insufficient. It does not explain return format for inline results, default values, or the effect of uid_field. The tool is complex and needs more detail to be fully usable.

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

Parameters2/5

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

Schema coverage is 0%, so the description must explain parameters. It covers as_layer, geometry_field, and layers, but omits query, uid_field, and layer_name. The query parameter is implied but not defined. This forces the agent to infer syntax and meaning.

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 executes SQL across loaded layers via a virtual layer, specifying the key capability. It distinguishes itself from sibling tools as the only SQL execution tool.

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 usage through mention of referencing layers by name and as_layer behavior, but lacks explicit guidance on when to use inline vs as_layer, or constraints on SQL statements. No alternatives are discussed, though it is unique among siblings.

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/awheeler262/qgis_mcp'

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