Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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.`,
          }],
        };
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/XWeaponX7/rundida-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server