Skip to main content
Glama

Wait for Map Viewer

ensure_map_viewer
Read-onlyIdempotent

Reports whether the person has the map open (viewer_status.connected) for a map_session_id from get_map_visualization, waiting up to wait_seconds (max 30 s per call; the result reports requested_wait_seconds and max_wait_seconds). Works the same for the in-chat map and the map_url tab. Returns VIEWER_NOT_CONNECTED while the map is still closed; the same call can be repeated while the person opens it. Build, analyze, and selection results paint live once the viewer is connected.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "map_session_id": "<map_session_id>"
    },
    "name": "ensure_map_viewer"
  }
}

Input Schema

NameRequiredDescriptionDefault
wait_secondsNoOptional server-side wait window. 0 returns the current snapshot only. Values above 30 are clamped to 30 s per call; on VIEWER_NOT_CONNECTED the error details carry requested_wait_seconds, max_wait_seconds, and next_call (call again).
map_session_idYesOpen map session (msess_...) from get_map_visualization.
poll_interval_msNo

Output Schema

NameRequiredDescriptionDefault
okYes
errorNoPresent when ok is false.
resultNoPresent when ok is true.
warningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / map_session_id / description
      Added value: +"Open map session (msess_...) from get_map_visualization."
    • addedInput schema / properties / wait_seconds / description
      Added value: +"Optional server-side wait window. 0 returns the current snapshot only. Values above 30 are clamped to 30 s per call; on VIEWER_NOT_CONNECTED the error details carry requested_wait_seconds, max_wait_seconds, and next_call (call again)."
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / properties
      Added value: +{
      +  "error": {
      +    "description": "Present when ok is false.",
      +    "properties": {
      +      "ask_user": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "code": {
      +        "type": "string"
      +      },
      +      "details": {
      +        "type": "object"
      +      },
      +      "do_this_next": {
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "ok": {
      +    "type": "boolean"
      +  },
      +  "result": {
      +    "description": "Present when ok is true.",
      +    "properties": {
      +      "map_session_id": {
      +        "type": "string"
      +      },
      +      "next_step": {
      +        "type": "string"
      +      },
      +      "suggested_action": {
      +        "type": "string"
      +      },
      +      "viewer_status": {
      +        "type": "object"
      +      },
      +      "waited_ms": {
      +        "type": "integer"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "warnings": {
      +    "items": {
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "ok"
      +]
    • removedOutput schema / title
      Removed value: -"ensure_map_viewerDictOutput"
  2. Changed1 schema field changed
    • removedInput schema / properties / guidance_handle
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Guidance Handle"
      -}
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description discloses the 30-second per-call wait cap, the VIEWER_NOT_CONNECTED status while the map is closed, that the call is safely repeatable, and that requested_wait_seconds/max_wait_seconds are reported in the result. It also explains the downstream effect that builds and analyses paint live once connected.

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?

The most important information — what it checks, the wait cap, and the repeat-when-not-connected behavior — is front-loaded. The sentences are dense but each carries signal; a slightly cleaner split of the wait/retry clause would improve readability.

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

Completeness4/5

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

An output schema exists so return shapes needn't be spelled out, yet the description still names the key VIEWER_NOT_CONNECTED state and the wait-related result fields an agent must branch on. The only gap is poll_interval_ms behavior, which neither structured data nor the description explains.

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 67%, and the description reinforces the wait_seconds clamp and the result fields that surface the requested vs max wait. It adds the retry/polling semantics around map_session_id, though poll_interval_ms is left undocumented in both the schema and the description, which keeps it from a 5.

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 description opens with a specific verb and resource — it reports whether the person has the map open for a given map_session_id, and that it waits. It also names the sibling that supplies the session id (get_map_visualization), so the agent can place it in the workflow without reading schemas.

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?

It tells the agent to call it with a map_session_id from get_map_visualization and that the same call can be repeated while the person opens the map, and it notes the behavior is identical for the in-chat map and the map_url tab. It stops short of explicit when-not-to-use guidance or naming alternatives, so it is clear but not exhaustive.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources