get_market_history
Retrieve historical price data for EVE Online items in specific regions to analyze market trends and make informed trading decisions.
Instructions
Returns the price history of an item in a particular region
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| regionId | Yes | Region ID | |
| typeId | Yes | Item type ID |
Implementation Reference
- src/server.ts:104-108 (handler)The execute handler for the get_market_history tool, which constructs the EVE Tycoon API endpoint for market history using the provided regionId and typeId, fetches the data via makeApiRequest, and returns it as a formatted JSON string.execute: async (args) => { const endpoint = `/v1/market/history/${args.regionId}/${args.typeId}`; const data = await makeApiRequest(endpoint); return JSON.stringify(data, null, 2); },
- src/server.ts:110-113 (schema)Zod input schema defining the required parameters: regionId (number) and typeId (number) for the get_market_history tool.parameters: z.object({ regionId: z.number().describe("Region ID"), typeId: z.number().describe("Item type ID"), }),
- src/server.ts:97-114 (registration)Full registration of the 'get_market_history' tool using FastMCP's server.addTool method, including annotations, description, inline handler, name, and parameters schema.server.addTool({ annotations: { openWorldHint: true, readOnlyHint: true, title: "Get Market History", }, description: "Returns the price history of an item in a particular region", execute: async (args) => { const endpoint = `/v1/market/history/${args.regionId}/${args.typeId}`; const data = await makeApiRequest(endpoint); return JSON.stringify(data, null, 2); }, name: "get_market_history", parameters: z.object({ regionId: z.number().describe("Region ID"), typeId: z.number().describe("Item type ID"), }), });
- src/server.ts:12-21 (helper)Shared utility function used by the tool handler to perform HTTP GET requests to the EVE Tycoon API (https://evetycoon.com/api), handling errors and returning parsed JSON.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(); }