get-market-stats
Retrieve real-time market statistics for a specified region in EVE Online using region ID. Access data via ESI API for accurate market insights and analysis.
Instructions
Get market statistics for a region
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region_id | Yes | Region ID to get statistics from |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"region_id": {
"description": "Region ID to get statistics from",
"type": "number"
}
},
"required": [
"region_id"
],
"type": "object"
}
Implementation Reference
- src/index.ts:423-436 (handler)The handler function that executes the tool logic: fetches market statistics from the EVE ESI API endpoint `/markets/${region_id}/stats/` using the makeESIRequest helper and returns a text content block with JSON-stringified stats.async ({ region_id }) => { const stats = await makeESIRequest<MarketStat[]>( `/markets/${region_id}/stats/` ); return { content: [ { type: "text", text: JSON.stringify(stats, null, 2) } ] }; }
- src/index.ts:420-422 (schema)Zod input schema defining the required 'region_id' parameter for the tool.{ region_id: z.number().describe("Region ID to get statistics from"), },
- src/index.ts:417-437 (registration)Registration of the 'get-market-stats' tool with server.tool(), including description, input schema, and inline handler.server.tool( "get-market-stats", "Get market statistics for a region", { region_id: z.number().describe("Region ID to get statistics from"), }, async ({ region_id }) => { const stats = await makeESIRequest<MarketStat[]>( `/markets/${region_id}/stats/` ); return { content: [ { type: "text", text: JSON.stringify(stats, null, 2) } ] }; } );
- src/index.ts:80-83 (schema)TypeScript interface defining the structure of individual market stat entries (name-value pairs) used for typing the API response in the handler.interface MarketStat { name: string; value: number; }