Skip to main content
Glama

get_station_services

Read-only

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

TableJSON 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)

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;
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true, indicating it's a safe read operation with open-world data. The description adds useful behavioral context beyond annotations by noting that including agents 'may be slower' and specifying a max of 50 stations, which helps the agent understand performance implications and limits. However, it lacks details on error handling or response format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence and efficiently adds supporting details in the second. Every sentence earns its place by clarifying scope and input flexibility without redundancy, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema), the description is reasonably complete. It covers the tool's purpose, input types, and key behavioral notes like performance trade-offs. However, without an output schema, it could benefit from hinting at the return structure (e.g., list of services) to fully guide the agent, though annotations provide safety context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds minimal semantic value beyond the schema by mentioning support for 'station IDs and names', which aligns with the 'stations' parameter but doesn't provide additional syntax or usage details. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get comprehensive station information') and resource ('station'), listing key data points like services, docking capabilities, and reprocessing facilities. It explicitly distinguishes from siblings by focusing on service information rather than routes, agents, or system data, making it easy to identify its unique function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('to get service information for stations'), and it implicitly suggests alternatives by mentioning support for both IDs and names, which might differ from sibling tools like 'station_name_to_id'. However, it does not explicitly state when not to use it or name specific alternatives, such as 'get_station_agents' for agent-focused queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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