list_guides
Retrieve a list of all running guides and educational articles. Browse training, pacing, and race preparation resources.
Instructions
List all running guides and educational articles on RunDida
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:361-370 (handler)The async handler function that executes the list_guides tool logic: fetches guides from the API, maps them to a formatted list, and returns the result as text content.
async () => { const data = await fetchJSON(`${BASE_URL}/api/guides.json`); const list = data.guides.map(g => `- ${g.title} [${g.slug}] (${g.category}): ${g.description.slice(0, 100)}...`).join('\n'); return { content: [{ type: 'text', text: `RunDida has ${data.meta.total} running guides:\n\n${list}\n\nUse get_guide with a slug to see full details including FAQs.`, }], }; } - index.js:356-371 (registration)Registration of the 'list_guides' tool on the MCP server using server.tool(), with a description and empty schema (no parameters).
// Tool: list_guides server.tool( 'list_guides', 'List all running guides and educational articles on RunDida', {}, async () => { const data = await fetchJSON(`${BASE_URL}/api/guides.json`); const list = data.guides.map(g => `- ${g.title} [${g.slug}] (${g.category}): ${g.description.slice(0, 100)}...`).join('\n'); return { content: [{ type: 'text', text: `RunDida has ${data.meta.total} running guides:\n\n${list}\n\nUse get_guide with a slug to see full details including FAQs.`, }], }; } ); - index.js:13-22 (helper)The fetchJSON helper function used by the handler 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; }