Skip to main content
Glama
mahdin75

GeoServer MCP Server

create_workspace

Generate a new workspace in GeoServer to organize and manage geospatial data. The tool allows users to define a workspace name, enabling structured access and configuration of spatial resources.

Instructions

Create a new workspace in GeoServer.

Args:
    workspace: Name of the workspace to create

Returns:
    Dict with status and result information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYes

Implementation Reference

  • The core handler function for the 'create_workspace' tool, decorated with @mcp.tool() for registration. It checks if the workspace exists, creates it via GeoServer REST API if not, and returns status information.
    @mcp.tool()
    def create_workspace(workspace: str) -> Dict[str, Any]:
        """Create a new workspace in GeoServer.
        
        Args:
            workspace: Name of the workspace to create
        
        Returns:
            Dict with status and result information
        """
        geo = get_geoserver()
        if geo is None:
            raise ValueError("Not connected to GeoServer")
        
        if not workspace:
            raise ValueError("Workspace name is required")
        
        try:
            # Check if workspace already exists
            existing_workspaces = geo.get_workspaces()
            if workspace in existing_workspaces:
                return {
                    "status": "info",
                    "workspace": workspace,
                    "message": f"Workspace '{workspace}' already exists"
                }
            
            # Use the actual GeoServer REST API to create a workspace
            geo.create_workspace(workspace)
            
            return {
                "status": "success",
                "workspace": workspace,
                "message": f"Workspace '{workspace}' created successfully"
            }
        except Exception as e:
            logger.error(f"Error creating workspace: {str(e)}")
            raise ValueError(f"Failed to create workspace: {str(e)}")
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. It states this is a creation operation, implying mutation, but doesn't address critical aspects like required permissions, whether the workspace name must be unique, what happens if it already exists, rate limits, or the format of the return dict. This leaves significant gaps for an agent to understand the tool's behavior.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first. The Args and Returns sections are structured clearly, though the return description ('Dict with status and result information') is somewhat vague. No sentences are wasted, but it could be slightly more informative without losing conciseness.

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 as a mutation operation with no annotations and no output schema, the description is incomplete. It doesn't explain the return value in detail, error conditions, or behavioral nuances like idempotency. For a tool that creates resources, this leaves the agent with insufficient context to use it effectively.

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?

The description adds minimal semantics beyond the input schema. It names the single parameter ('workspace') and states it's the 'Name of the workspace to create', which slightly clarifies the schema's 'Workspace' title. However, with 0% schema description coverage, this doesn't fully compensate—it lacks details like naming constraints, character limits, or examples. The baseline is 3 since the schema covers the parameter structure, but the description provides only basic clarification.

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

Purpose4/5

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

The description clearly states the action ('Create a new workspace') and resource ('in GeoServer'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'list_workspaces' or 'delete_resource' beyond the obvious verb difference.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., authentication needs), when not to use it, or how it relates to sibling tools like 'list_workspaces' for checking existing workspaces before creation.

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

Related 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/mahdin75/geoserver-mcp'

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