Skip to main content
Glama

get_qgis_info

Retrieve essential QGIS software details and configuration data to verify installation status and prepare for GIS project workflows.

Instructions

Get QGIS information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary MCP tool handler for 'get_qgis_info'. Proxies the request to the QGIS socket server via send_command.
    @mcp.tool()
    def get_qgis_info(ctx: Context) -> str:
        """Get QGIS information"""
        qgis = get_qgis_connection()
        result = qgis.send_command("get_qgis_info")
        return json.dumps(result, indent=2)
  • Core execution logic for 'get_qgis_info' in the QGIS plugin socket server. Returns QGIS version, profile folder, and active plugins count.
    def get_qgis_info(self, **kwargs):
        """Get basic QGIS information"""
        return {
            "qgis_version": Qgis.version(),
            "profile_folder": QgsApplication.qgisSettingsDirPath(),
            "plugins_count": len(active_plugins)
        }
  • Registration of the 'get_qgis_info' handler (and others) in the QGIS plugin's command dispatcher.
    handlers = {
        "ping": self.ping,
        "get_qgis_info": self.get_qgis_info,
        "load_project": self.load_project,
        "get_project_info": self.get_project_info,
        "execute_code": self.execute_code,
        "add_vector_layer": self.add_vector_layer,
        "add_raster_layer": self.add_raster_layer,
        "get_layers": self.get_layers,
        "remove_layer": self.remove_layer,
        "zoom_to_layer": self.zoom_to_layer,
        "get_layer_features": self.get_layer_features,
        "execute_processing": self.execute_processing,
        "save_project": self.save_project,
        "render_map": self.render_map,
        "create_new_project": self.create_new_project,
    }
  • Helper function to manage persistent connection to the QGIS socket server, used by the MCP tool.
    def get_qgis_connection():
        """Get or create a persistent Qgis connection"""
        global _qgis_connection
        
        # If we have an existing connection, check if it's still valid
        if _qgis_connection is not None:
            # Test if the connection is still alive with a simple ping
            try:
                # Just try to send a small message to check if the socket is still connected
                _qgis_connection.sock.sendall(b'')
                return _qgis_connection
            except Exception as e:
                # Connection is dead, close it and create a new one
                logger.warning(f"Existing connection is no longer valid: {str(e)}")
                try:
                    _qgis_connection.disconnect()
                except Exception:
                    pass
                _qgis_connection = None
        
        # Create a new connection if needed
        if _qgis_connection is None:
            _qgis_connection = QgisMCPServer(host="localhost", port=9876)
            if not _qgis_connection.connect():
                logger.error("Failed to connect to Qgis")
                _qgis_connection = None
                raise Exception("Could not connect to Qgis. Make sure the Qgis plugin is running.")
            logger.info("Created new persistent connection to Qgis")
        
        return _qgis_connection
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal insight. 'Get QGIS information' implies a read-only operation, but it doesn't specify what information is returned (e.g., structured data, status messages), whether it requires specific permissions, or if there are any side effects like caching or logging. The description is too vague to adequately inform agent behavior beyond a basic read intent.

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

Conciseness3/5

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

The description is extremely concise ('Get QGIS information'), which could be efficient if it were more informative. However, it's under-specified rather than appropriately concise—it lacks the specificity needed to be truly helpful. While it's front-loaded (the entire description is in three words), it fails to earn its place by adding sufficient value beyond the tool name.

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?

Given the complexity of QGIS (a geographic information system with multiple components), the description is incomplete. With no annotations, no output schema, and a vague purpose, it doesn't provide enough context for an agent to understand what information is retrieved or how to interpret results. Sibling tools suggest this might return system-level info, but the description doesn't confirm this or explain the return format.

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?

The tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description doesn't need to compensate for any parameter documentation gaps. A baseline score of 4 is appropriate since there are no parameters to explain, and the description doesn't introduce unnecessary complexity about inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get QGIS information' is a tautology that essentially restates the tool name without adding meaningful specificity. It doesn't clarify what type of QGIS information is retrieved (e.g., version, configuration, available plugins, system status) or distinguish this from sibling tools like 'get_project_info' or 'get_layers' that also retrieve information about QGIS components.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. Given sibling tools like 'get_project_info' (for project details) and 'get_layers' (for layer information), there's no indication whether this tool is for general system information, configuration details, or something else, nor any prerequisites or context for its use.

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/syauqi-uqi/qgis_mcp_modify1'

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