tmap_route
Plan driving routes in Korea with real-time traffic data. Provides distance, estimated arrival time, toll fees, and turn-by-turn directions for efficient navigation.
Instructions
Get Korean driving routes with real-time traffic via TMap Navigation API. Returns distance, ETA, toll fees, and turn-by-turn directions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startX | Yes | Start longitude (WGS84) | |
| startY | Yes | Start latitude (WGS84) | |
| endX | Yes | End longitude (WGS84) | |
| endY | Yes | End latitude (WGS84) | |
| startName | No | Start location name | |
| endName | No | End location name |
Implementation Reference
- src/index.ts:16-39 (handler)The generic tool handler in src/index.ts iterates through tools and executes them by making an API request using 'gatewayRequest'. The 'tmap_route' tool is dynamically registered here and handled by this function.
server.tool( tool.name, tool.description, tool.inputSchema.shape, async (params) => { const method = tool.method || "POST"; const result = await gatewayRequest(method, tool.endpoint, params as Record<string, unknown>); if (result.error) { return { content: [{ type: "text" as const, text: `Error (${result.status}): ${result.error}` }], isError: true, }; } const text = typeof result.data === "string" ? result.data : JSON.stringify(result.data, null, 2); return { content: [{ type: "text" as const, text }], }; }, ); - src/tools/tmap.ts:8-15 (schema)The schema definition for 'tmap_route', which uses Zod to define the required parameters like start/end coordinates.
inputSchema: z.object({ startX: z.string().describe("Start longitude (WGS84)"), startY: z.string().describe("Start latitude (WGS84)"), endX: z.string().describe("End longitude (WGS84)"), endY: z.string().describe("End latitude (WGS84)"), startName: z.string().optional().describe("Start location name"), endName: z.string().optional().describe("End location name"), }), - src/tools/tmap.ts:5-17 (registration)The registration of the 'tmap_route' tool, providing its description, schema, and API endpoint.
{ name: "tmap_route", description: "Get Korean driving routes with real-time traffic via TMap Navigation API. Returns distance, ETA, toll fees, and turn-by-turn directions.", inputSchema: z.object({ startX: z.string().describe("Start longitude (WGS84)"), startY: z.string().describe("Start latitude (WGS84)"), endX: z.string().describe("End longitude (WGS84)"), endY: z.string().describe("End latitude (WGS84)"), startName: z.string().optional().describe("Start location name"), endName: z.string().optional().describe("End location name"), }), endpoint: "/v1/tmap/route", },