Skip to main content
Glama

region_info

Retrieve detailed EVE Online region data, including constellations, systems, and boundaries, by providing numeric region IDs using ESI and SDE APIs.

Instructions

Get comprehensive region information from both ESI and SDE APIs, including constellations, systems, and boundaries

Input Schema

NameRequiredDescriptionDefault
regionIdsYesArray of region IDs to get information for (max 50). Use numeric IDs only, not names. Use region_name_to_id tool to convert names to IDs first.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "regionIds": { "description": "Array of region IDs to get information for (max 50). Use numeric IDs only, not names. Use region_name_to_id tool to convert names to IDs first.", "items": { "type": "number" }, "maxItems": 50, "minItems": 1, "type": "array" } }, "required": [ "regionIds" ], "type": "object" }

Implementation Reference

  • The complete definition of the 'region_info' tool object, including the execute handler function that fetches and combines region data from ESI and SDE APIs.
    export const regionInfoTool = { annotations: { openWorldHint: true, // This tool interacts with external APIs readOnlyHint: true, // This tool doesn't modify anything title: "Region Information", }, description: "Get comprehensive region information from both ESI and SDE APIs, including constellations, systems, and boundaries", execute: async (args: { regionIds: number[] }) => { try { const results: CombinedRegionInfo[] = []; for (const regionId of args.regionIds) { let esiData: ESIRegionInfo | undefined; let sdeData: SDERegionInfo | undefined; // Fetch from ESI try { esiData = await esiClient.getRegionInfo(regionId); } catch (error) { console.warn(`Failed to fetch ESI data for region ${regionId}:`, error); } // Fetch from SDE try { sdeData = await sdeClient.getRegionInfo(regionId); } catch (error) { console.warn(`Failed to fetch SDE data for region ${regionId}:`, error); } const combined = await combineRegionData(esiData, sdeData); if (combined) { results.push(combined); } } if (results.length === 0) { return JSON.stringify({ success: false, message: "No region information found for the provided IDs", results: [] }); } return JSON.stringify({ success: true, message: `Found information for ${results.length} region(s)`, results: results }); } catch (error) { return JSON.stringify({ success: false, message: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`, results: [] }); } }, name: "region_info", parameters: z.object({ regionIds: z.array(z.number()).min(1).max(50).describe("Array of region IDs to get information for (max 50). Use numeric IDs only, not names. Use region_name_to_id tool to convert names to IDs first.") }), };
  • Zod schema defining the input parameters for the region_info tool: an array of region IDs.
    parameters: z.object({ regionIds: z.array(z.number()).min(1).max(50).describe("Array of region IDs to get information for (max 50). Use numeric IDs only, not names. Use region_name_to_id tool to convert names to IDs first.") }),
  • src/server.ts:55-58 (registration)
    Registration of the regionInfoTool (region_info) by adding it to the FastMCP server.
    // Add region information tools server.addTool(regionInfoTool); server.addTool(constellationInfoTool); server.addTool(regionSystemsListTool);
  • Helper function to combine ESI and SDE region data, resolve constellation and system names, and build comprehensive region info.
    async function combineRegionData( esiData?: ESIRegionInfo, sdeData?: SDERegionInfo ): Promise<CombinedRegionInfo | null> { if (!esiData && !sdeData) return null; const regionId = esiData?.region_id || sdeData?.regionID; if (!regionId) return null; // Collect all IDs that need names const idsToResolve: number[] = []; const constellationIds = esiData?.constellations || (sdeData?.constellations?.map(id => parseInt(id)) || []); idsToResolve.push(...constellationIds); // Get all systems in the region by fetching constellation data const systemIds: number[] = []; if (constellationIds.length > 0) { for (const constId of constellationIds) { try { const constInfo = await esiClient.getConstellationInfo(constId); systemIds.push(...constInfo.systems); } catch (error) { console.warn(`Failed to fetch constellation ${constId}:`, error); } } } idsToResolve.push(...systemIds); // Resolve names let nameMap = new Map<number, string>(); if (idsToResolve.length > 0) { try { const nameResults = await esiClient.idsToNames(idsToResolve); nameMap = new Map(nameResults.map(result => [result.id, result.name])); } catch (error) { console.warn('Failed to fetch names for region data:', error); } } return { region_id: regionId, name: esiData?.name || `Region ${regionId}`, description: esiData?.description, position: sdeData?.center ? { x: sdeData.center[0], y: sdeData.center[1], z: sdeData.center[2], } : undefined, bounds: (sdeData?.max && sdeData?.min) ? { max: { x: sdeData.max[0], y: sdeData.max[1], z: sdeData.max[2] }, min: { x: sdeData.min[0], y: sdeData.min[1], z: sdeData.min[2] }, } : undefined, constellations: constellationIds.map(id => { const name = nameMap.get(id); return name ? `${id} (${name})` : `${id}`; }), systems: systemIds.length > 0 ? systemIds.map(id => { const name = nameMap.get(id); return name ? `${id} (${name})` : `${id}`; }) : undefined, source: { esi: !!esiData, sde: !!sdeData, }, esi_data: esiData, sde_data: sdeData, }; }
  • TypeScript interface defining the structure of combined region information used by the tool.
    export interface CombinedRegionInfo { region_id: number; name: string; description?: string; position?: { x: number; y: number; z: number; }; bounds?: { max: { x: number; y: number; z: number }; min: { x: number; y: number; z: number }; }; constellations: string[]; systems?: string[]; source: { esi: boolean; sde: boolean; }; esi_data?: ESIRegionInfo; sde_data?: SDERegionInfo; }

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/kongyo2/eve-online-traffic-mcp'

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