Skip to main content
Glama
nkarasiak

QGIS MCP

by nkarasiak

Add Layer from Connection

add_layer_from_connection

Load a database table or SQL query from a saved connection into the QGIS project as a new layer, using optional schema, geometry, and primary key settings.

Instructions

Load a table from a saved connection as a project layer. Pass table (+ schema), or sql to build a query layer executed by the database. For a SQL layer, geometry_column and primary_key may be needed for QGIS to map/identify the result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlNo
nameNo
tableNo
schemaNo
providerYes
connectionYes
primary_keyNo
geometry_columnNo
Behavior3/5

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

With no annotations, the description carries the burden. It discloses that SQL layers are executed by the database and that geometry_column and primary_key may be needed for QGIS mapping. However, it does not mention side effects, permissions, or behavior if the layer already exists, leaving some behavioral ambiguity.

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 three sentences, front-loaded with the core purpose, and each sentence adds distinct value. No redundancy or filler.

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 tool with 8 parameters and no output schema, the description covers the primary use cases and key requirements (like geometry columns for SQL layers). It misses some parameter details but provides enough context for effective use in most scenarios.

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 description coverage is 0%, so the description must compensate. It explains table, schema, sql, geometry_column, and primary_key but leaves provider, connection, and name unexplained. This partial coverage is helpful but incomplete for an 8-parameter tool.

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 function: loading a table or SQL query from a saved connection as a project layer. The verb 'Load' and resource 'table from a saved connection' are specific, and the mention of SQL query layers distinguishes it from simple file-based layer additions.

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 explains the two main usage modes (pass table+schema or SQL) but does not explicitly compare with alternatives like add_vector_layer or execute_connection_sql. Usage context is implied but not contrasted, so the agent receives reasonable but not explicit guidance.

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