region_name_to_id
Convert EVE Online region names into their corresponding IDs using the ESI API. Input an array of up to 500 region names for accurate ID mapping within the 'eve-online-traffic-mcp' server.
Instructions
Convert EVE Online region names to their corresponding IDs using ESI API
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| regionNames | Yes | Array of region names to convert to IDs (max 500). Use English proper nouns only (e.g., 'The Forge', 'Domain', 'Sinq Laison') |
Implementation Reference
- src/name-to-id-tools.ts:110-138 (handler)The execute function that implements the core logic of the region_name_to_id tool. It calls the ESI client to resolve region names to IDs, handles empty results and errors, and returns a formatted JSON response.execute: async (args: { regionNames: string[] }) => { try { const results = await esiClient.getRegionIds(args.regionNames); if (results.length === 0) { return JSON.stringify({ success: false, message: "No regions found with the provided names", results: [] }); } return JSON.stringify({ success: true, message: `Found ${results.length} region(s)`, results: results.map(region => ({ id: region.id, name: region.name, type: "region" })) }); } catch (error) { return JSON.stringify({ success: false, message: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`, results: [] }); } },
- src/name-to-id-tools.ts:140-142 (schema)Zod schema defining the input parameters for the tool: an array of up to 500 region names.parameters: z.object({ regionNames: z.array(z.string()).min(1).max(500).describe("Array of region names to convert to IDs (max 500). Use English proper nouns only (e.g., 'The Forge', 'Domain', 'Sinq Laison')") }),
- src/server.ts:47-47 (registration)Registration of the regionNameToIdTool object with the FastMCP server.server.addTool(regionNameToIdTool);
- src/esi-client.ts:271-274 (helper)Supporting helper method in ESIClient that filters region results from the universal namesToIds ESI API call.async getRegionIds(regionNames: string[]): Promise<Array<{ id: number; name: string }>> { const result = await this.namesToIds(regionNames); return result.regions || []; }
- src/server.ts:3-6 (registration)Import of the regionNameToIdTool from name-to-id-tools.js for use in server registration.solarSystemNameToIdTool, stationNameToIdTool, regionNameToIdTool, universalNameToIdTool