Skip to main content
Glama

Describe GL JS API

describe_gl_js_api
Read-only

Look up MapLibre GL JS APIs to verify existence, signatures, parameters, defaults, documentation, and examples for classes, methods, options, events, or functions.

Instructions

Looks up a class, method, option, event or function of MapLibre GL JS, like "Map", "Map#flyTo", "MapOptions.maxPitch", "click" or "addProtocol", in the type definitions that GL JS ships. Returns its signature, documentation, parameters, default and examples, and for a class or an options type, its members. Answers for the GL JS version this server renders with, or for another version, like the one a project uses. Check here before using a method or option you are not sure exists in MapLibre, since Mapbox GL JS has some that MapLibre GL JS does not.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name to look up, like "Map#flyTo", "flyTo" or "MapOptions".
versionNoA GL JS version or range, like "5.6.0" or "5", whose type definitions are fetched from jsDelivr. Defaults to the version this server renders with.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint and openWorldHint, so safety is already covered. The description adds meaningful behavior beyond that: results are scoped to a GL JS version, non-default versions are fetched from jsDelivr, and the return content (signature, documentation, parameters, default, examples, class/options members) is disclosed. It does not discuss latency or failure modes of the remote fetch, which is a minor gap.

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?

Three sentences with no filler: purpose and accepted key formats first, then what is returned, then version scoping and the Mapbox caveat. The example keys are load-bearing disambiguation rather than padding.

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

Completeness5/5

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

With no output schema, the description carries the return-value burden and does so explicitly. It covers lookup targets, return payload, versioning behavior, and the primary risk (assuming Mapbox-only APIs exist in MapLibre), leaving nothing an agent needs to invoke it correctly.

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%, so the schema already documents both parameters and the baseline is 3. The description goes further by showing accepted name shapes ("Map", "Map#flyTo", "MapOptions.maxPitch", "click", "addProtocol") and clarifying that version may be a range like "5" or a point release, plus what the default resolves to.

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?

States a specific verb (looks up) and a precise resource (class, method, option, event, or function of MapLibre GL JS), reinforced by concrete example keys like "Map#flyTo" and "MapOptions.maxPitch". It is clearly distinguishable from sibling tools such as describe_style_spec or describe_sources, which cover style/source spec material rather than the GL JS API surface.

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

Usage Guidelines4/5

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

Explicitly tells the agent to check here before using a method or option whose existence is uncertain, and explains the Mapbox-vs-MapLibre divergence as the reason. It also explains version selection (server version by default, or a project's version). It stops short of naming a sibling tool as an alternative, so it is clear context rather than a full when/when-not/alternatives statement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.