Skip to main content
Glama
mahdin75

GeoServer MCP Server

list_layers

Retrieve a list of layers in GeoServer, optionally filtered by workspace. Returns detailed layer information for geospatial data management and analysis.

Instructions

List layers in GeoServer, optionally filtered by workspace.

Args:
    workspace: Optional workspace to filter layers

Returns:
    List of layer information dictionaries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceNo

Implementation Reference

  • The handler function for the 'list_layers' MCP tool. It connects to GeoServer via the Geoserver client, lists layers (optionally filtered by workspace), and returns a list of layer dictionaries. The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool()
    def list_layers(workspace: Optional[str] = None) -> List[Dict[str, Any]]:
        """List layers in GeoServer, optionally filtered by workspace.
        
        Args:
            workspace: Optional workspace to filter layers
        
        Returns:
            List of layer information dictionaries
        """
        geo = get_geoserver()
        if geo is None:
            raise ValueError("Not connected to GeoServer")
        
        try:
            # Use the actual GeoServer REST API to list layers
            if workspace:
                layers = geo.get_layers(workspace)
            else:
                layers = geo.get_layers()
            
            return layers
        except Exception as e:
            logger.error(f"Error listing layers: {str(e)}")
            raise ValueError(f"Failed to list layers: {str(e)}")
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. It mentions the tool lists layers and returns information dictionaries, but lacks details on permissions required, pagination behavior, rate limits, error conditions, or what fields the dictionaries contain. This is a significant gap for a tool with no 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 front-loaded with the core purpose, followed by clear Arg and Returns sections in a structured format. Every sentence earns its place with no redundant information, making it efficient and easy to parse.

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 no annotations, 0% schema description coverage, and no output schema, the description is moderately complete. It covers the purpose and parameter semantics adequately but lacks behavioral details like permissions or error handling. For a simple read operation, this is acceptable but not thorough.

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?

Schema description coverage is 0%, so the description must compensate. It documents the single parameter 'workspace' as optional for filtering, adding meaning beyond the schema's basic type and title. However, it doesn't explain the format of workspace names or provide examples, leaving some ambiguity.

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 'layers in GeoServer', with optional workspace filtering. It distinguishes the tool from siblings like 'get_layer_info' (detailed info) and 'list_workspaces' (different resource). However, it doesn't explicitly contrast with 'query_features' (data querying vs metadata listing).

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

Usage Guidelines3/5

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

The description implies usage for listing layers, optionally filtered by workspace, but doesn't explicitly state when to use this versus alternatives like 'get_layer_info' (for detailed info on a specific layer) or 'query_features' (for querying layer data). No guidance on prerequisites or exclusions is provided.

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