get_traveler_view_info
Retrieve the current traveler's location address, nearby facilities, and optional scenery photos to enhance virtual journey insights on Map Traveler MCP.
Instructions
Get the address of the current traveler's location and information on nearby facilities,view snapshot
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeNearbyFacilities | No | Get information on nearby facilities | |
| includePhoto | No | Get scenery photos of current location |
Implementation Reference
- src/McpService.ts:264-283 (registration)Tool definition and registration in makeToolsDef: conditionally names the tool 'get_traveler_view_info' (non-second person mode), defines input schema for optional booleans includePhoto and includeNearbyFacilities, title, description. Included in tools list returned by ListToolsRequestSchema handler.{ name: env.personMode === 'second' ? "get_current_view_info" : "get_traveler_view_info", title: "Get the current location's view", description: env.personMode === 'second' ? "Get the address of the current location and information on nearby facilities,view snapshot" : "Get the address of the current traveler's location and information on nearby facilities,view snapshot", inputSchema: { type: "object", properties: { includePhoto: { type: "boolean", description: "Get scenery photos of current location" }, includeNearbyFacilities: { type: "boolean", description: "Get information on nearby facilities" }, } } },
- src/McpService.ts:1029-1031 (handler)Dispatch handler in toolSwitch function (invoked by MCP CallToolRequestSchema): matches tool name and calls getCurrentLocationInfo with parsed arguments.case "get_traveler_view_info": return getCurrentLocationInfo(request.params.arguments?.includePhoto as boolean, request.params.arguments?.includeNearbyFacilities as boolean,env) case "reach_a_percentage_of_destination":
- src/McpService.ts:566-568 (helper)Thin wrapper helper: invokes RunnerService.getCurrentView with current time and parameters, handling practice mode.const getCurrentLocationInfo = (includePhoto: boolean, includeNearbyFacilities: boolean,env:Mode) => { return RunnerService.getCurrentView(dayjs(), includePhoto, includeNearbyFacilities, env.isPractice) }
- src/RunnerService.ts:290-296 (handler)Primary handler implementation: Retrieves current run status, computes elapsed ratio, updates if ended, delegates to makeView for status-specific view generation.function getCurrentView(now: dayjs.Dayjs, includePhoto: boolean, includeNearbyFacilities: boolean, practice = false) { return Effect.gen(function* () { const {runStatus, justArrive, elapseRatio} = yield* getRunStatusAndUpdateEnd(now,practice); // ただし前回旅が存在し、それが終了していても、そのendTimeから1時間以内ならその場所にいるものとして表示する return yield* makeView(runStatus, elapseRatio, justArrive && dayjs().isBefore(dayjs.unix(runStatus.tilEndEpoch).add(1, "hour")), includePhoto, includeNearbyFacilities, practice) }) }
- src/RunnerService.ts:298-350 (handler)Generates view based on trip status: 'vehicle' (special prompts/images), 'stop' (hotel image), 'running' (facilities, street/AI image, location text); formats ToolContentResponse with text/image.function makeView(runStatus: RunStatus, elapseRatio: number, showRunning: boolean, includePhoto: boolean, includeNearbyFacilities: boolean, practice = false, debugRoute?: string) { return Effect.gen(function* () { let loc: LocationDetail let viewStatus: TripStatus; const runnerEnv = yield* DbService.getSysEnv() // const env = yield *DbService.getSysMode() if (practice) { loc = { status: runStatus.status, lat: runStatus.endLat, lng: runStatus.endLng, bearing: MapService.getBearing(runStatus.startLat, runStatus.startLng, runStatus.endLat, runStatus.endLng), timeZoneId: 'Asia/Tokyo', remainSecInPath: 0, maneuver: undefined, isEnd: true, landPathNo: -1, } viewStatus = runStatus.status; } else { loc = yield* calcCurrentLoc(runStatus, elapseRatio, debugRoute); // これは計算位置情報 viewStatus = loc.status; yield* McpLogService.logTrace(`getCurrentView:elapseRatio:${elapseRatio},start:${runStatus.startTime},end:${dayjs.unix(runStatus.tilEndEpoch)},status:${loc.status}`) if (showRunning) { viewStatus = 'running' } // skip移動モードのときは例外的に画像情報はrunningにする(stop=ホテル画面ではなく、今の場所の画面を生成する) if (runnerEnv.mode.moveMode === "skip" && viewStatus === "stop") { viewStatus = 'running' } } switch (viewStatus) { case 'vehicle': return yield* vehicleView(loc, includePhoto,runnerEnv); case 'stop': return yield* hotelView(practice ? 'Asia/Tokyo' : loc.timeZoneId, includePhoto, runStatus.to, runnerEnv) case "running": const { nearFacilities, image, locText } = yield* (practice ? getFacilitiesPractice(runStatus.to, includePhoto) : getFacilities(loc, runnerEnv, includePhoto, false)) return yield* runningReport(locText, includeNearbyFacilities ? nearFacilities : undefined, image, false, showRunning).pipe(Effect.andThen(a => a.out)) } }).pipe(Effect.catchAll(e => { if (e instanceof AnswerError) { return Effect.fail(e) } return McpLogService.logError(`getCurrentView catch:${e},${JSON.stringify(e)}`).pipe(Effect.andThen(() => Effect.fail(new AnswerError("Sorry,I don't know where you are right now. Please wait a moment and ask again.")))); })) }