get-structure-type-orders
Retrieve market orders for a specific item type within a structure using structure ID and type ID. Ideal for accessing real-time market data in EVE Online via ESI API integration.
Instructions
Get all market orders for a specific type in a structure
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Which page to query, starts at 1 | |
| structure_id | Yes | Structure ID to get market orders from | |
| type_id | Yes | Item type ID to get orders for |
Implementation Reference
- src/index.ts:448-469 (handler)The handler function that constructs the ESI endpoint for structure market orders by type ID, fetches the orders using makeESIRequest, formats them by selecting key fields, and returns them as JSON text content.async ({ structure_id, type_id, page }) => { const endpoint = `/markets/structures/${structure_id}/types/${type_id}/${page ? `?page=${page}` : ''}`; const orders = await makeESIRequest<MarketOrder[]>(endpoint); return { content: [ { type: "text", text: JSON.stringify(orders.map(order => ({ order_id: order.order_id, price: order.price, volume_remain: order.volume_remain, volume_total: order.volume_total, is_buy_order: order.is_buy_order, duration: order.duration, issued: order.issued, range: order.range })), null, 2) } ] }; }
- src/index.ts:443-447 (schema)Zod input schema defining parameters: structure_id (required number), type_id (required number), page (optional number).{ structure_id: z.number().describe("Structure ID to get market orders from"), type_id: z.number().describe("Item type ID to get orders for"), page: z.number().optional().describe("Which page to query, starts at 1"), },
- src/index.ts:440-470 (registration)The server.tool call that registers the 'get-structure-type-orders' tool with name, description, input schema, and inline handler function.server.tool( "get-structure-type-orders", "Get all market orders for a specific type in a structure", { structure_id: z.number().describe("Structure ID to get market orders from"), type_id: z.number().describe("Item type ID to get orders for"), page: z.number().optional().describe("Which page to query, starts at 1"), }, async ({ structure_id, type_id, page }) => { const endpoint = `/markets/structures/${structure_id}/types/${type_id}/${page ? `?page=${page}` : ''}`; const orders = await makeESIRequest<MarketOrder[]>(endpoint); return { content: [ { type: "text", text: JSON.stringify(orders.map(order => ({ order_id: order.order_id, price: order.price, volume_remain: order.volume_remain, volume_total: order.volume_total, is_buy_order: order.is_buy_order, duration: order.duration, issued: order.issued, range: order.range })), null, 2) } ] }; } );