Skip to main content
Glama

set_layer_paint

Set paint properties (colors, opacity) on a map layer and its sub-layers to update its visual style.

Instructions

Set MapLibre paint properties (e.g. colors, opacity) for a layer and all its sub-layers.


📚 AVAILABLE DATA LAYERS & USAGE CONTEXT

Available Data Layers

You have access to map visualization tools that can display geospatial data layers.

Note: These layer definitions can be customized by setting the MCP_MAP_SYSTEM_PROMPT environment variable with your own layer information.

Base Layers (Raster)

OpenStreetMap Standard

  • ID: osm

  • Type: Raster

  • URL: https://tile.openstreetmap.org/{z}/{x}/{y}.png

  • Attribution: © OpenStreetMap contributors

  • Description: Standard OpenStreetMap tiles with streets, labels, and geographic features

OpenStreetMap Humanitarian

  • ID: osm-humanitarian

  • Type: Raster

  • URL: https://tile-{s}.openstreetmap.fr/hot/{z}/{x}/{y}.png

  • Subdomains: a,b,c

  • Attribution: © OpenStreetMap contributors, Tiles courtesy of Humanitarian OpenStreetMap Team

  • Description: High-contrast humanitarian style, good for overlaying data

CartoDB Positron (Light)

  • ID: carto-light

  • Type: Raster

  • URL: https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png

  • Subdomains: a,b,c,d

  • Attribution: © OpenStreetMap contributors © CARTO

  • Description: Light grayscale base map, excellent for data visualization

Esri World Imagery

  • ID: esri-satellite

  • Type: Raster

  • URL: https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}

  • Attribution: Tiles © Esri

  • Description: High-resolution satellite imagery

Vector Data Layers

World Database on Protected Areas (WDPA)

  • ID: wdpa

  • Type: Vector

  • URL: pmtiles://https://s3-west.nrp-nautilus.io/public-wdpa/WDPA_Dec2025.pmtiles

  • Source Layer: wdpa

  • Description: Global protected areas dataset with IUCN categorization and management information

Attributes:

  • IUCN_CAT: IUCN management category (Ia=Strict Nature Reserve, Ib=Wilderness Area, II=National Park, III=Natural Monument, IV=Habitat Management, V=Protected Landscape, VI=Sustainable Use)

  • OWN_TYPE: Ownership type (State, Private, Community, etc.)

  • ISO3: ISO 3166-1 alpha-3 country code

  • STATUS_YR: Year of establishment or designation

  • NAME: Protected area name

  • DESIG_ENG: Designation in English (e.g., National Park, Wildlife Sanctuary)

Overture Maps - Administrative Boundaries

  • ID: overture-admins

  • Type: Vector

  • URL: pmtiles://https://overturemaps.azureedge.net/release/2024-11-13.0/theme=admins.pmtiles

  • Source Layer: admins

  • Description: Administrative boundary polygons including countries, states/regions, and counties

Attributes:

  • admin_level: Administrative level (2=country, 4=state/region, 6=county)

  • names: Name information in multiple languages

  • iso_country_code_alpha_2: ISO country code

  • iso_sub_country_code: Sub-country codes

Overture Maps - Places

  • ID: overture-places

  • Type: Vector

  • URL: pmtiles://https://overturemaps.azureedge.net/release/2024-11-13.0/theme=places.pmtiles

  • Source Layer: places

  • Description: Points of interest including businesses, landmarks, and facilities

Attributes:

  • categories: Category classification

  • names: Place names in multiple languages

  • confidence: Data confidence score

Natural Earth Countries (50m)

  • ID: ne-countries

  • Type: Vector

  • URL: pmtiles://https://cdn.protomaps.com/data/ne-50m-countries.pmtiles

  • Source Layer: countries

  • Description: Country boundaries at 1:50m scale from Natural Earth

Attributes:

  • NAME: Country name

  • ISO_A2: ISO Alpha-2 country code

  • POP_EST: Population estimate

  • GDP_MD: GDP in millions USD

  • CONTINENT: Continent name

Example Usage Patterns

Create a base map:

{
  "tool": "add_layer",
  "arguments": {
    "id": "osm-base",
    "type": "raster",
    "source": {
      "type": "raster",
      "tiles": ["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],
      "attribution": "© OpenStreetMap contributors"
    }
  }
}

Add protected areas in a specific country:

{
  "tool": "add_layer", 
  "arguments": {
    "id": "wdpa",
    "type": "vector",
    "source": {
      "type": "vector",
      "url": "pmtiles://https://s3-west.nrp-nautilus.io/public-wdpa/WDPA_Dec2025.pmtiles"
    },
    "layers": [{
      "id": "wdpa-fill",
      "type": "fill",
      "source": "wdpa",
      "source-layer": "wdpa",
      "paint": {"fill-color": "green", "fill-opacity": 0.5}
    }]
  }
}

Filter to specific country (e.g., USA):

{
  "tool": "filter_layer",
  "arguments": {
    "layer_id": "wdpa",
    "filter": ["==", ["get", "ISO3"], "USA"]
  }
}

Style by attribute (e.g., IUCN category):

{
  "tool": "set_layer_paint",
  "arguments": {
    "layer_id": "wdpa",
    "property": "fill-color",
    "value": [
      "match",
      ["get", "IUCN_CAT"],
      "II", "#2ca02c",
      "IV", "#1f77b4", 
      "V", "#ff7f0e",
      "#999999"
    ]
  }
}

Tips for Layer Selection

  • Always start with a base layer (OSM, CartoDB, or Esri)

  • Use light base maps (carto-light) when overlaying lots of data

  • Use satellite imagery (esri-satellite) for environmental or geographic context

  • PMTiles sources are efficient for large vector datasets

  • Filter by geography first (ISO3, admin_level) to improve performance

  • Use meaningful colors and opacity for multiple overlapping layers


Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNoOptional map state JSON string.
valueYesThe new value for the paint property.
layer_idYesThe ID of the layer to style.
propertyYesThe paint property name (e.g. 'fill-color', 'raster-opacity').
session_idNoThe session ID.
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits, but it only mentions applying paint 'for a layer and all its sub-layers.' It does not explain side effects, reversibility, required permissions, or behavior on invalid properties. The large layer catalog is irrelevant to the tool's behavior, so the actual behavioral coverage is minimal.

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

Conciseness2/5

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

The actual tool description is only one sentence, but the rest is a massive block of unrelated layer catalog content (base layers, vector layers, generic tips). This bloat harms conciseness and buries the relevant usage example. The front-loaded sentence is good, but the overall structure is poor for a tool description.

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?

The description provides enough context for the core operation, especially with the styled example, but it omits details about return values, errors, or the optional state/session parameters. Given no annotations and no output schema, the description partially compensates with examples but remains incomplete for a polished agent-facing tool spec.

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?

Schema coverage is 100% with basic parameter descriptions. The tool description adds value by giving concrete examples of valid property names ('fill-color', 'raster-opacity') and showing that 'value' can be a complex expression like a match on an attribute (e.g., IUCN_CAT). This goes beyond the schema's generic 'new value' description.

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

Purpose5/5

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

The opening sentence clearly states the tool's function: 'Set MapLibre paint properties (e.g. colors, opacity) for a layer and all its sub-layers.' This specific verb-resource combination distinguishes it from sibling tools like filter_layer and add_layer, and the sub-layer scope adds precision.

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 includes a detailed example showing when to use set_layer_paint (e.g., styling by attribute with a match expression), which implies usage context. However, it lacks explicit when-to-use vs. alternative guidance, such as comparing to filter_layer or add_layer. The 'Tips' section is generic and does not address tool selection.

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/boettiger-lab/mcp-map-server'

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