Skip to main content
Glama

get_station_services

Retrieve detailed station information for EVE Online, including available services, docking options, reprocessing facilities, and optional system or agent data, using station IDs or names.

Instructions

Get comprehensive station information including available services, docking capabilities, and reprocessing facilities. Supports both station IDs and names.

Input Schema

NameRequiredDescriptionDefault
includeAgentsNoWhether to include agent information (may be slower)
includeSystemInfoNoWhether to include system security status and region information
stationsYesArray of station names (English proper nouns like 'Jita IV - Moon 4 - Caldari Navy Assembly Plant') or IDs to get service information for (max 50)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "includeAgents": { "default": false, "description": "Whether to include agent information (may be slower)", "type": "boolean" }, "includeSystemInfo": { "default": true, "description": "Whether to include system security status and region information", "type": "boolean" }, "stations": { "description": "Array of station names (English proper nouns like 'Jita IV - Moon 4 - Caldari Navy Assembly Plant') or IDs to get service information for (max 50)", "items": { "type": [ "string", "number" ] }, "maxItems": 50, "minItems": 1, "type": "array" } }, "required": [ "stations" ], "type": "object" }

Implementation Reference

  • The main handler function (execute) for the get_station_services tool. It processes input stations (names or IDs), fetches data from ESI API (station info, system info, names), maps services, optionally includes agents, and returns structured station information.
    execute: async (args: { stations: (string | number)[]; includeSystemInfo?: boolean; includeAgents?: boolean; }) => { try { if (args.stations.length === 0) { return JSON.stringify({ success: false, message: "At least one station must be provided", stations: [] }); } if (args.stations.length > 50) { return JSON.stringify({ success: false, message: "Maximum 50 stations allowed per request", stations: [] }); } const results: CombinedStationInfo[] = []; const errors: string[] = []; // Convert station names to IDs if needed const stationIds: number[] = []; const stringStations = args.stations.filter(s => typeof s === 'string') as string[]; const numericStations = args.stations.filter(s => typeof s === 'number') as number[]; stationIds.push(...numericStations); if (stringStations.length > 0) { try { const stationIdResults = await esiClient.getStationIds(stringStations); stationIds.push(...stationIdResults.map(s => s.id)); // Check for stations that weren't found const foundNames = stationIdResults.map(s => s.name.toLowerCase()); const notFound = stringStations.filter(name => !foundNames.includes(name.toLowerCase()) ); notFound.forEach(name => { errors.push(`Station '${name}' not found`); }); } catch (error) { errors.push(`Error converting station names to IDs: ${error instanceof Error ? error.message : 'Unknown error'}`); } } // Get station information for (const stationId of stationIds) { try { const stationInfo = await esiClient.getStationInfo(stationId); // Collect IDs for name resolution const idsToResolve: number[] = [ stationInfo.system_id, stationInfo.type_id, stationInfo.owner ]; if (stationInfo.race_id) { idsToResolve.push(stationInfo.race_id); } // Get system info for region and security status let systemInfo; let regionId: number | undefined; let securityStatus: number | undefined; let securityClass: string | undefined; if (args.includeSystemInfo !== false) { try { systemInfo = await esiClient.getSolarSystemInfo(stationInfo.system_id); regionId = systemInfo.constellation_id; // We'll need to get region from constellation securityStatus = systemInfo.security_status; securityClass = systemInfo.security_class; // Get constellation info to get region try { const constellationInfo = await esiClient.getConstellationInfo(systemInfo.constellation_id); regionId = constellationInfo.region_id; idsToResolve.push(regionId); } catch (error) { console.warn(`Failed to get constellation info for ${systemInfo.constellation_id}:`, error); } } catch (error) { console.warn(`Failed to get system info for ${stationInfo.system_id}:`, error); } } // Resolve names let nameMap = new Map<number, string>(); 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 station data:', error); } // Process services const services = stationInfo.services.map(serviceKey => ({ service_key: serviceKey, service_name: STATION_SERVICES[serviceKey as keyof typeof STATION_SERVICES] || serviceKey, available: true })); // Get agents if requested let agentInfos: Array<{ agent_id: number; agent_name?: string; agent_type?: string; corporation_name?: string; division_id?: number; level?: number; quality?: number; is_locator?: boolean; is_research_agent?: boolean; }> | undefined; if (args.includeAgents) { try { const agents = await sdeClient.getAgentsByLocation(stationInfo.station_id); agentInfos = []; for (const agent of agents) { try { // Get agent name and corporation info const agentIdsToResolve: number[] = [agent.characterID]; if (agent.corporationID) agentIdsToResolve.push(agent.corporationID); let agentNameMap = new Map<number, string>(); try { const agentNameResults = await esiClient.idsToNames(agentIdsToResolve); agentNameMap = new Map(agentNameResults.map(result => [result.id, result.name])); } catch (error) { console.warn('Failed to resolve agent names:', error); } // Get agent type info let agentTypeName: string | undefined; if (agent.agentTypeID) { try { const agentTypeInfo = await sdeClient.getAgentTypeInfo(agent.agentTypeID); agentTypeName = agentTypeInfo.agentType; } catch (error) { console.warn(`Failed to get agent type ${agent.agentTypeID}:`, error); } } agentInfos.push({ agent_id: agent.characterID, agent_name: agentNameMap.get(agent.characterID), agent_type: agentTypeName, corporation_name: agent.corporationID ? agentNameMap.get(agent.corporationID) : undefined, division_id: agent.divisionID, level: agent.level, quality: agent.quality, is_locator: agent.isLocator || false, is_research_agent: false // We don't check research agents here for performance }); } catch (error) { console.warn(`Failed to process agent ${agent.characterID}:`, error); } } } catch (error) { console.warn(`Failed to get agents for station ${stationInfo.station_id}:`, error); } } const combinedInfo: CombinedStationInfo = { station_id: stationInfo.station_id, name: stationInfo.name, system_id: stationInfo.system_id, system_name: nameMap.get(stationInfo.system_id), region_id: regionId, region_name: regionId ? nameMap.get(regionId) : undefined, type_id: stationInfo.type_id, type_name: nameMap.get(stationInfo.type_id), position: stationInfo.position, owner_id: stationInfo.owner, owner_name: nameMap.get(stationInfo.owner), race_id: stationInfo.race_id, race_name: stationInfo.race_id ? nameMap.get(stationInfo.race_id) : undefined, services, docking_info: { max_dockable_ship_volume: stationInfo.max_dockable_ship_volume, office_rental_cost: stationInfo.office_rental_cost }, reprocessing_info: { efficiency: stationInfo.reprocessing_efficiency, stations_take: stationInfo.reprocessing_stations_take }, security_status: securityStatus, security_class: securityClass, agents: agentInfos }; results.push(combinedInfo); } catch (error) { errors.push(`Error fetching station ${stationId}: ${error instanceof Error ? error.message : 'Unknown error'}`); } } return JSON.stringify({ success: results.length > 0, message: `Found information for ${results.length} station(s)`, stations: results, errors: errors.length > 0 ? errors : undefined, summary: { total_stations_requested: args.stations.length, successful_stations: results.length, failed_stations: errors.length, service_summary: { most_common_services: getMostCommonServices(results), unique_services: getUniqueServices(results) } } }); } catch (error) { return JSON.stringify({ success: false, message: `Error getting station services: ${error instanceof Error ? error.message : 'Unknown error'}`, stations: [] }); } },
  • Zod schema defining input parameters for the tool: stations array (1-50 names/IDs), optional flags for system info and agents.
    name: "get_station_services", parameters: z.object({ stations: z.array(z.union([z.string(), z.number()])).min(1).max(50).describe("Array of station names (English proper nouns like 'Jita IV - Moon 4 - Caldari Navy Assembly Plant') or IDs to get service information for (max 50)"), includeSystemInfo: z.boolean().optional().default(true).describe("Whether to include system security status and region information"), includeAgents: z.boolean().optional().default(false).describe("Whether to include agent information (may be slower)") }),
  • src/server.ts:69-69 (registration)
    Registration of the getStationServicesTool with the FastMCP server.
    server.addTool(getStationServicesTool);
  • TypeScript interface defining the structure of station information returned by the tool.
    export interface CombinedStationInfo { station_id: number; name: string; system_id: number; system_name?: string; region_id?: number; region_name?: string; type_id: number; type_name?: string; position: { x: number; y: number; z: number; }; owner_id: number; owner_name?: string; race_id?: number; race_name?: string; services: Array<{ service_key: string; service_name: string; available: boolean; }>; docking_info: { max_dockable_ship_volume: number; office_rental_cost: number; }; reprocessing_info: { efficiency: number; stations_take: number; }; security_status?: number; security_class?: string; agents?: Array<{ agent_id: number; agent_name?: string; agent_type?: string; corporation_name?: string; division_id?: number; level?: number; quality?: number; is_locator?: boolean; is_research_agent?: boolean; }>; }
  • Constant mapping station service keys from ESI to human-readable service names, used in service processing.
    const STATION_SERVICES = { 'bounty-missions': 'Bounty Missions', 'assasination-missions': 'Assassination Missions', 'courier-missions': 'Courier Missions', 'interbus': 'Interbus', 'reprocessing-plant': 'Reprocessing Plant', 'refinery': 'Refinery', 'market': 'Market', 'black-market': 'Black Market', 'stock-exchange': 'Stock Exchange', 'cloning': 'Cloning', 'surgery': 'Surgery', 'dna-therapy': 'DNA Therapy', 'repair-facilities': 'Repair Facilities', 'factory': 'Factory', 'labratory': 'Laboratory', 'gambling': 'Gambling', 'fitting': 'Fitting', 'paintshop': 'Paintshop', 'news': 'News', 'storage': 'Storage', 'insurance': 'Insurance', 'docking': 'Docking', 'office-rental': 'Office Rental', 'jump-clone-facility': 'Jump Clone Facility', 'loyalty-point-store': 'Loyalty Point Store', 'navy-offices': 'Navy Offices', 'security-offices': 'Security Offices' } as const;

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