get_market_orders
Retrieve current market order books for EVE Online items with filtering by region, system, or location to analyze trading opportunities.
Instructions
Returns the current order book for an item type, with metadata about the type and locations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| typeId | Yes | Item type ID | |
| regionId | No | Region ID to filter on | |
| systemId | No | System ID to filter on | |
| locationId | No | Location ID (station, structure) to filter on |
Implementation Reference
- src/server.ts:66-86 (handler)The execute handler function constructs the API endpoint based on typeId and optional filters (regionId, systemId, locationId), fetches data from evetycoon.com API using makeApiRequest, and returns JSON string.execute: async (args) => { let endpoint = `/v1/market/orders/${args.typeId}`; const params = new URLSearchParams(); if (args.regionId) { params.append('regionId', args.regionId.toString()); } if (args.systemId) { params.append('systemId', args.systemId.toString()); } if (args.locationId) { params.append('locationId', args.locationId.toString()); } if (params.toString()) { endpoint += `?${params.toString()}`; } const data = await makeApiRequest(endpoint); return JSON.stringify(data, null, 2); },
- src/server.ts:88-93 (schema)Zod schema for input parameters: required typeId, optional regionId, systemId, locationId.parameters: z.object({ typeId: z.number().describe("Item type ID"), regionId: z.number().optional().describe("Region ID to filter on"), systemId: z.number().optional().describe("System ID to filter on"), locationId: z.number().optional().describe("Location ID (station, structure) to filter on"), }),
- src/server.ts:59-94 (registration)Registers the 'get_market_orders' tool with FastMCP server, including annotations, description, execute handler, name, and parameters schema.server.addTool({ annotations: { openWorldHint: true, readOnlyHint: true, title: "Get Market Orders", }, description: "Returns the current order book for an item type, with metadata about the type and locations", execute: async (args) => { let endpoint = `/v1/market/orders/${args.typeId}`; const params = new URLSearchParams(); if (args.regionId) { params.append('regionId', args.regionId.toString()); } if (args.systemId) { params.append('systemId', args.systemId.toString()); } if (args.locationId) { params.append('locationId', args.locationId.toString()); } if (params.toString()) { endpoint += `?${params.toString()}`; } const data = await makeApiRequest(endpoint); return JSON.stringify(data, null, 2); }, name: "get_market_orders", parameters: z.object({ typeId: z.number().describe("Item type ID"), regionId: z.number().optional().describe("Region ID to filter on"), systemId: z.number().optional().describe("System ID to filter on"), locationId: z.number().optional().describe("Location ID (station, structure) to filter on"), }), });
- src/server.ts:12-21 (helper)Shared helper function used by get_market_orders (and other tools) to perform fetch requests to the EVE Tycoon API.async function makeApiRequest(endpoint: string): Promise<any> { const url = `${BASE_URL}${endpoint}`; const response = await fetch(url); if (!response.ok) { throw new Error(`API request failed: ${response.status} ${response.statusText}`); } return response.json(); }