list_tools
List all running calculators and tools available on RunDida, covering marathon events, pace/time/distance calculations, race predictions, and heart rate training zones.
Instructions
List all available running calculators and tools on RunDida
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:117-132 (registration)Registration of the 'list_tools' MCP tool via server.tool(), also containing the inline handler logic.
// Tool: list_tools server.tool( 'list_tools', 'List all available running calculators and tools on RunDida', {}, async () => { const data = await fetchJSON(`${BASE_URL}/api/tools.json`); const list = data.tools.map(t => `- ${t.title} (${t.slug}): ${t.description}`).join('\n'); return { content: [{ type: 'text', text: `RunDida has ${data.meta.total} running tools:\n\n${list}\n\nUse get_tool with a slug to see full details.`, }], }; } ); - index.js:122-131 (handler)Handler function that fetches tools data from the API, formats a list, and returns a text response.
async () => { const data = await fetchJSON(`${BASE_URL}/api/tools.json`); const list = data.tools.map(t => `- ${t.title} (${t.slug}): ${t.description}`).join('\n'); return { content: [{ type: 'text', text: `RunDida has ${data.meta.total} running tools:\n\n${list}\n\nUse get_tool with a slug to see full details.`, }], }; } - index.js:121-121 (schema)Schema (empty object) indicating 'list_tools' takes no input parameters.
{}, - index.js:13-22 (helper)Helper function used by list_tools to fetch data from the RunDida API with caching.
async function fetchJSON(url) { const cached = cache.get(url); if (cached && Date.now() - cached.ts < CACHE_TTL) return cached.data; const res = await fetch(url); if (!res.ok) throw new Error(`HTTP ${res.status}: ${url}`); const data = await res.json(); cache.set(url, { data, ts: Date.now() }); return data; }