Skip to main content
Glama
masx200

AMap Maps MCP Server

by masx200

maps_bicycling

Plan bicycle routes for commuting by considering overpasses, one-way streets, and road closures. Supports routes up to 500km between specified coordinates.

Instructions

骑行路径规划用于规划骑行通勤方案,规划时会考虑天桥、单行线、封路等情况。最大支持 500km 的骑行路线规划

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
originYes出发点经纬度,坐标格式为:经度,纬度
destinationYes目的地经纬度,坐标格式为:经度,纬度

Implementation Reference

  • The handleBicycling function implements the core logic for the maps_bicycling tool by querying the AMAP API for bicycling routes between origin and destination.
    async function handleBicycling(origin, destination) { const url = new URL("https://restapi.amap.com/v4/direction/bicycling"); url.searchParams.append("key", AMAP_MAPS_API_KEY); url.searchParams.append("origin", origin); url.searchParams.append("destination", destination); url.searchParams.append("source", "ts_mcp"); const response = await fetch(url.toString()); const data = await response.json(); if (data.errcode !== 0) { return { content: [{ type: "text", text: `Direction bicycling failed: ${data.info || data.infocode}`, }], isError: true, }; } return { content: [{ type: "text", text: JSON.stringify( { data: { origin: data.data.origin, destination: data.data.destination, paths: data.data.paths.map((path) => { return { distance: path.distance, duration: path.duration, steps: path.steps.map((step) => { return { instruction: step.instruction, road: step.road, distance: step.distance, orientation: step.orientation, duration: step.duration, }; }), }; }), }, }, null, 2, ), }], isError: false, };
  • Schema definition for the maps_bicycling tool, including input schema for origin and destination coordinates.
    const BICYCLING_TOOL = { name: "maps_bicycling", description: "骑行路径规划用于规划骑行通勤方案,规划时会考虑天桥、单行线、封路等情况。最大支持 500km 的骑行路线规划", inputSchema: { type: "object", properties: { origin: { type: "string", description: "出发点经纬度,坐标格式为:经度,纬度", }, destination: { type: "string", description: "目的地经纬度,坐标格式为:经度,纬度", }, }, required: ["origin", "destination"], }, };
  • build/index.js:874-877 (registration)
    Registration of the maps_bicycling tool in the CallToolRequestSchema handler switch statement.
    case "maps_bicycling": { const { origin, destination } = request.params.arguments; return await handleBicycling(origin, destination); }
  • Duplicate implementation of the handleBicycling function in the HTTP server version.
    async function handleBicycling(origin, destination) { const AMAP_MAPS_API_KEY = getApiKey(); const url = new URL("https://restapi.amap.com/v4/direction/bicycling"); url.searchParams.append("key", AMAP_MAPS_API_KEY); url.searchParams.append("origin", origin); url.searchParams.append("destination", destination); url.searchParams.append("source", "ts_mcp"); const response = await fetch(url.toString()); const data = await response.json(); if (data.errcode !== 0) { return { content: [ { type: "text", text: `Direction bicycling failed: ${data.info || data.infocode}`, }, ], isError: true, }; } return { content: [ { type: "text", text: JSON.stringify( { data: { origin: data.data.origin, destination: data.data.destination, paths: data.data.paths.map((path) => { return { distance: path.distance, duration: path.duration, steps: path.steps.map((step) => { return { instruction: step.instruction, road: step.road, distance: step.distance, orientation: step.orientation, duration: step.duration, }; }), }; }), }, }, null, 2, ), }, ], isError: false, };
  • Schema definition for the maps_bicycling tool in the HTTP server factory function.
    const BICYCLING_TOOL = { name: "maps_bicycling", description: "骑行路径规划用于规划骑行通勤方案,规划时会考虑天桥、单行线、封路等情况。最大支持 500km 的骑行路线规划", inputSchema: { type: "object", properties: { origin: { type: "string", description: "出发点经纬度,坐标格式为:经度,纬度", }, destination: { type: "string", description: "目的地经纬度,坐标格式为:经度,纬度", }, }, required: ["origin", "destination"], }, };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/masx200/amap-maps-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server