Skip to main content
Glama
Magic Lane MCP DevKit Server

Magic Lane MCP DevKit Server

Official
by magiclane

Validate Style

validate_style
Read-onlyIdempotent

Validates Magic Lane style JSON offline against the engine schema, reporting every problem with its JSON path plus warnings for non-schema checks before saving.

Instructions

Validate a Magic Lane style JSON document offline against the published engine style schema, without calling the portal (unless an id is given, which fetches the style first). Reports every problem with its JSON path, unlike the portal which reports only the first. Of the rules the schema cannot express ("checksNotInSchema" lists them all), it checks layer id order, group and icon references, unique image ids, minzoom ≤ maxzoom and the declared satellite source, and reports them as warnings; it does not check that the background layer comes last, that image and font data are real files, nor image sizes. "warnings" lists what to fix before saving, also when it came from a template: apply each "fix", ask the user where "askUser" is true, make the change the message names where there is neither, and tell the user what you fixed. If one cannot be fixed, or the user keeps it, say so and leave it: warnings never block a save. "warnings" holds only the checks this server makes, so an empty list does not mean Studio shows no warning. "notes" need no change. Use it before update_style or create_style with data. Reference: get_style_reference: the essentials with no arguments (resource magiclane://docs/style-essentials), the full format with page "style-file-format" (https://developer.magiclane.com/docs/guides/map-studio/reference/style-file-format/)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "validate_style"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoId of a style or template to fetch from the portal and validate.
dataNoThe style JSON document to validate.
pathNoPath of a .json style file to read and validate. Prefer an absolute path: a relative one is taken from the folder MAGICLANE_FILES_DIR names when the server has one, otherwise the server's working directory. A path that starts with ~/ or ~user/ is refused: ~ is not read as a home folder.
maxProblemsNoMaximum number of problems to report (default 50).

Output Schema

NameRequiredDescriptionDefault
notesYesThings to know that need no change.
validYesTrue when the document has no schema problem; warnings do not count.
sourceYesWhat was validated.
problemsYesSchema problems, at most maxProblems; empty when valid.
schemaIdYesThe $id of the schema the document was checked against.
warningsYesWhat to fix in the style. Fix them before saving (or save again), also when they came from a template: apply each "fix", ask the user where askUser is true, make the change the message names where there is neither, and tell the user what you fixed. If one cannot be fixed, or the user keeps it, say so and leave it: warnings never block a save. Only the checks this server makes: an empty list does not mean Studio shows no warning.
truncatedYesProblems counted but not listed.
checksNotInSchemaYesEvery rule the schema cannot express. This server checks the ones about layer ids, groups, icon names, image ids, zoom ranges and the satellite source, and reports them in warnings. It does not check that the background layer comes last, that image and font data are real files, or the image sizes (Studio or the map checks the last two).
warningsTruncatedYeswarnings counted but not listed: validate again after fixing the listed ones.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses that validation is offline unless an id triggers a fetch, that it reports every problem with a JSON path while the portal reports only the first, and enumerates both the checks made and the checks deliberately skipped. It also states that warnings never block a save and that an empty warnings list does not mean Studio shows no warning — non-obvious behavior an agent could otherwise get wrong.

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?

Purpose and the offline-vs-portal contrast are front-loaded, and the detail that follows is substantive rather than filler. It is dense and runs long with many quoted field names, and the fix-application flow sits a little far from the validation core, but no sentence is wasted.

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?

Covers what an agent needs despite the output schema: it explains the meaning of warnings, notes and checksNotInSchema, the non-blocking nature of warnings, and the important caveat about warning-list completeness. Given the tool's complexity and nested object input, this is complete.

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 all four parameters and the baseline would be 3. The description adds genuine meaning for `id` by explaining it triggers a portal fetch before validation, which changes the call's network behavior, and frames `data`/`path` as alternative inputs.

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 and resource ("Validate a Magic Lane style JSON document") and immediately scopes it: offline against the published engine style schema, not the portal. It is clearly distinguishable from siblings by naming update_style, create_style and get_style_reference as different concerns.

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

Usage Guidelines5/5

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

Gives an explicit trigger ("Use it before update_style or create_style with data") and routes reference lookup to get_style_reference, including the exact page argument. It also explains the id-vs-document distinction, so an agent knows which entry path to take.

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