Skip to main content
Glama
nkarasiak

QGIS MCP

by nkarasiak

Export Session Script

export_session

Export all QGIS session changes since server start as a Python script that replays them from the console. Optionally write to a file or start a new journal.

Instructions

Every command that changed something in this QGIS since the plugin's server started (read-only calls left out), as a Python script that replays them from the QGIS Python console. Layer ids are remapped on replay. Returns the script, or writes it to 'path' and returns the path. clear: start a new journal afterwards. Commands from every connected client are in it; a restore_checkpoint rewinds it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
clearNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.15.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries full weight. It disclosure layer id remapping on replay, the path/clear behaviors, inclusion of all clients, and how restore_checkpoint affects the journal. It could mention potential limitations (e.g., size of script, behavior with no changes) but overall it is transparent about the tool's operational details.

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 compact yet information-dense. Four sentences deliver purpose, key behavior (remapping), output mode and clear flag, and scope (all clients, restore_checkpoint interplay). Every sentence adds value without fluff, and the core purpose is front-loaded.

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 only 2 optional parameters and no output schema, the description covers the essential aspects: what it exports, how parameters affect output, and relevant behavioral nuances. It could elaborate on edge cases (e.g., what happens if no changes exist) but is sufficiently complete for an agent to invoke it correctly.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate. It does: 'path' is explained as where to write the script (or returning the script if null), and 'clear' is described as starting a new journal afterward. Both parameter purposes are semantically defined beyond the schema's type-only declarations.

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 states a specific verb+resource (export the session's change commands as a Python script) and distinguishes it from other export tools by emphasizing it replays all mutating commands from the plugin server's start. It clearly differentiates from sibling export tools like export_layer, export_layout, and export_atlas.

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

Usage Guidelines4/5

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

The description provides clear context on what the tool covers (only change commands, not read-only calls; includes all client commands) and hints at interplay with restore_checkpoint. It doesn't explicitly state when not to use it or name alternatives, but the context is enough to infer its niche among the many sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools