Skip to main content
Glama

execute_processing

Run QGIS processing algorithms with specified parameters to perform geospatial analysis and data manipulation tasks.

Instructions

Execute a processing algorithm with the given parameters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
algorithmYes
parametersYes

Implementation Reference

  • Core handler that executes the QGIS processing algorithm using the processing.run() function. This is the actual implementation performing the tool logic.
    def execute_processing(self, algorithm, parameters, **kwargs): """Execute a processing algorithm""" try: import processing result = processing.run(algorithm, parameters) return { "algorithm": algorithm, "result": {k: str(v) for k, v in result.items()} # Convert values to strings for JSON } except Exception as e: raise Exception(f"Processing error: {str(e)}")
  • MCP tool handler for 'execute_processing'. Proxies the request to the QGIS plugin server via socket connection.
    @mcp.tool() def execute_processing(ctx: Context, algorithm: str, parameters: dict) -> str: """Execute a processing algorithm with the given parameters.""" qgis = get_qgis_connection() result = qgis.send_command("execute_processing", {"algorithm": algorithm, "parameters": parameters}) return json.dumps(result, indent=2)
  • Registration of all command handlers in the QGIS plugin server, including 'execute_processing' mapped to its handler method.
    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, }
  • Specific registration entry for 'execute_processing' in the plugin's handlers dictionary.
    "execute_processing": self.execute_processing,
  • Client-side wrapper method for sending 'execute_processing' command to the QGIS server.
    def execute_processing(self, algorithm, parameters): """Execute a processing algorithm""" return self.send_command("execute_processing", { "algorithm": algorithm, "parameters": parameters })

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