get_markets
Retrieve a comprehensive list of available trading markets with detailed symbol information for cryptocurrency trading analysis and decision-making.
Instructions
List all available trading markets with their symbol info.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:295-306 (handler)The 'get_markets' tool handler - calls the API endpoint '/markets' to retrieve all available trading markets and returns the data as JSON text. Takes no input parameters.
// Tool: get_markets server.tool( "get_markets", "List all available trading markets with their symbol info.", {}, async () => { const data = await apiGet<unknown[]>("/markets"); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }; } ); - src/index.ts:91-100 (helper)Helper function used by get_markets to make authenticated GET requests to the API. Constructs the full URL from API_BASE and path, adds auth headers, and parses the JSON response.
async function apiGet<T>(path: string): Promise<T> { const res = await fetch(`${API_BASE}${path}`, { headers: getAuthHeaders(), }); if (!res.ok) { const text = await res.text(); throw new Error(`API GET ${path} failed (${res.status}): ${text}`); } return res.json() as Promise<T>; }