get_my_runs
Check your active autonomous trading runs, view performance metrics, and monitor current status on the simulated crypto exchange.
Instructions
Get your Autonomous participation status. Shows all your active runs, their performance, and current status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:444-449 (handler)The handler function for get_my_runs tool. It calls apiGet to fetch the user's runs from '/me/runs' endpoint and returns the JSON data as text content.
async () => { const data = await apiGet<unknown[]>("/me/runs"); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }; } - src/index.ts:439-450 (registration)Registration of the get_my_runs tool using server.tool() with name, description, empty input schema, and async handler function.
// Tool: get_my_runs server.tool( "get_my_runs", "Get your Autonomous participation status. Shows all your active runs, their performance, and current status.", {}, async () => { const data = await apiGet<unknown[]>("/me/runs"); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }; } ); - src/index.ts:91-100 (helper)The apiGet helper function used by the get_my_runs handler. It performs an authenticated GET request to the API and returns the parsed 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>; }