Wait for Map Viewer
ensure_map_viewerReports 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
| Name | Required | Description | Default |
|---|---|---|---|
| wait_seconds | No | 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). | |
| map_session_id | Yes | Open map session (msess_...) from get_map_visualization. | |
| poll_interval_ms | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | Present when ok is false. | |
| result | No | Present when ok is true. | |
| warnings | No |