Skip to main content
Glama
mahdin75

GeoServer MCP Server

list_workspaces

Retrieve available workspaces in GeoServer to manage and organize geospatial data effectively through the MCP server.

Instructions

List available workspaces in GeoServer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_workspaces' MCP tool. It connects to GeoServer via get_geoserver(), retrieves the list of workspaces using geo.get_workspaces(), and returns them as a List[str]. Includes error handling with logging and raises ValueError on failure. The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()
    def list_workspaces() -> List[str]:
        """List available workspaces in GeoServer."""
        geo = get_geoserver()
        if geo is None:
            raise ValueError("Not connected to GeoServer")
        
        try:
            # Use the actual GeoServer REST API to list workspaces
            workspaces = geo.get_workspaces()
            return workspaces
        except Exception as e:
            logger.error(f"Error listing workspaces: {str(e)}")
            raise ValueError(f"Failed to list workspaces: {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 the action but doesn't describe what 'available' means (e.g., filtered by permissions), the return format, pagination, or error conditions. This is inadequate for a tool with zero annotation coverage.

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 a single, efficient sentence with zero waste. It's appropriately sized for a simple tool and front-loaded with the core purpose, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate but lacks completeness. It doesn't explain what 'available' entails or provide behavioral context, which could help the agent use it correctly despite the low complexity.

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 with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter details, and it correctly doesn't mention any, earning a baseline 4 for parameter semantics.

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 verb ('List') and resource ('available workspaces in GeoServer'), providing a specific purpose. However, it doesn't explicitly differentiate from sibling tools like 'list_layers' or 'create_workspace', which would require a 5.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., before creating layers), or exclusions, leaving the agent to infer usage from the tool name alone.

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