list_marathons
Retrieve marathon events tracked by RunDida with dates and locations for race planning and scheduling.
Instructions
List all marathon events tracked by RunDida with dates and locations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:152-170 (handler)The implementation of the 'list_marathons' tool, which fetches data from the RunDida API and formats it for output.
// Tool: list_marathons server.tool( 'list_marathons', 'List all marathon events tracked by RunDida with dates and locations', {}, async () => { const data = await fetchJSON(`${BASE_URL}/api/marathons.json`); const list = data.active .sort((a, b) => a.date.localeCompare(b.date)) .map(m => `- ${m.name.en} — ${m.date} — ${m.city}`) .join('\n'); return { content: [{ type: 'text', text: `RunDida tracks ${data.meta.totalActive} upcoming marathons:\n\n${list}\n\nUse get_marathon with an ID for details.`, }], }; } );