station_name_to_id
Convert EVE Online station names to their unique IDs using the ESI API. Input an array of station names (max 500) to retrieve corresponding IDs for navigation and traffic management.
Instructions
Convert EVE Online station names to their corresponding IDs using ESI API
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stationNames | Yes | Array of station names to convert to IDs (max 500). Use English proper nouns only (e.g., 'Jita IV - Moon 4 - Caldari Navy Assembly Plant') |
Implementation Reference
- src/name-to-id-tools.ts:65-93 (handler)The main handler function (execute) for the station_name_to_id tool. It calls the ESI client to resolve station names to IDs and formats the JSON response.execute: async (args: { stationNames: string[] }) => { try { const results = await esiClient.getStationIds(args.stationNames); if (results.length === 0) { return JSON.stringify({ success: false, message: "No stations found with the provided names", results: [] }); } return JSON.stringify({ success: true, message: `Found ${results.length} station(s)`, results: results.map(station => ({ id: station.id, name: station.name, type: "station" })) }); } catch (error) { return JSON.stringify({ success: false, message: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`, results: [] }); } },
- src/name-to-id-tools.ts:95-97 (schema)Zod schema defining the input parameters for the tool: an array of station names (1-500 strings).parameters: z.object({ stationNames: z.array(z.string()).min(1).max(500).describe("Array of station names to convert to IDs (max 500). Use English proper nouns only (e.g., 'Jita IV - Moon 4 - Caldari Navy Assembly Plant')") }),
- src/server.ts:46-46 (registration)Registration of the stationNameToIdTool with the MCP server.server.addTool(stationNameToIdTool);
- src/esi-client.ts:263-266 (helper)Helper method in ESIClient that resolves station names to IDs via ESI /universe/ids/ API endpoint.async getStationIds(stationNames: string[]): Promise<Array<{ id: number; name: string }>> { const result = await this.namesToIds(stationNames); return result.stations || []; }