Skip to main content
Glama

create_new_project

Create and save a new QGIS project by specifying a file path, enabling users to start working with geographic data and analysis.

Instructions

Create a new project a save it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • MCP tool handler for create_new_project that proxies the command to the QGIS plugin server
    @mcp.tool()
    def create_new_project(ctx: Context, path: str) -> str:
        """Create a new project a save it"""
        qgis = get_qgis_connection()
        result = qgis.send_command("create_new_project", {"path": path})
        return json.dumps(result, indent=2)
  • Registration of the create_new_project command handler in the QGIS plugin's execute_command 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,
    }
  • Core implementation of create_new_project in QGIS plugin: clears existing project, sets new path, refreshes canvas, and saves the project file
    def create_new_project(self, path, **kwargs):
        """
        Creates a new QGIS project and saves it at the specified path.
        If a project is already loaded, it clears it before creating the new one.
        
        :param project_path: Full path where the project will be saved
                            (e.g., 'C:/path/to/project.qgz')
        """
        project = QgsProject.instance()
        
        if project.fileName():
            project.clear()
        
        project.setFileName(path)
        self.iface.mapCanvas().refresh()
        
        # Save the project
        if project.write():
            return {
                "created": f"Project created and saved successfully at: {path}",
                "layer_count": len(project.mapLayers())
            }
        else:
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Create a new project a save it,' which implies a write operation but lacks details on permissions, whether it overwrites existing files, error handling, or output format. For a mutation tool with zero annotation coverage, this is insufficient to inform safe and effective use.

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 brief ('Create a new project a save it'), which is concise but suffers from a grammatical error ('a save it' likely intended as 'and save it'). It front-loads the core action but lacks structure, such as separating creation and saving aspects. While not verbose, the error reduces clarity.

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 tool's complexity (a mutation operation with 1 parameter), no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't cover behavioral traits, parameter details, or output expectations, making it inadequate for effective tool selection and invocation by an AI agent.

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?

The input schema has 1 parameter ('path') with 0% description coverage, and the tool description provides no information about parameters. It doesn't explain what 'path' represents (e.g., file path, directory), expected format, or constraints. With low schema coverage, the description fails to compensate, leaving the parameter's meaning unclear.

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 'Create a new project a save it' restates the tool name ('create_new_project') with minor elaboration, making it tautological. It specifies the action ('create') and resource ('project') but lacks clarity on what 'a save it' means—likely a typo for 'and save it'—which doesn't differentiate it from sibling tools like 'save_project' or 'load_project'.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing a valid path, or differentiate from sibling tools like 'save_project' (which might update existing projects) or 'load_project' (which opens existing ones). The description implies creation and saving, but without explicit usage context.

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