Skip to main content
Glama

get_marathon

Provide a marathon ID or slug to receive race details, countdown, and Schema.org structured data.

Instructions

Get detailed information about a specific marathon including countdown and Schema.org data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesMarathon ID or slug, e.g. "tokyo", "boston", "berlin2026", "kobe2026"

Implementation Reference

  • Handler function for the get_marathon tool. Fetches marathon details from the API by ID/slug, with a fallback that strips the year suffix. Returns race details including date, city, country, timezone, countdown days, weather, course profile, and links.
      async ({ id }) => {
        let data;
        try {
          data = await fetchJSON(`${BASE_URL}/api/marathons/${id}.json`);
        } catch {
          // Fallback: try slug without year for Tier 1 marathons
          const slug = id.replace(/\d{4}$/, '');
          data = await fetchJSON(`${BASE_URL}/api/marathons/${slug}.json`);
        }
        const m = data.marathon;
        const raceDate = new Date(m.date);
        const now = new Date();
        const daysUntil = Math.ceil((raceDate - now) / (1000 * 60 * 60 * 24));
        let text = `## ${m.name.en}\n\nDate: ${m.date}\nCity: ${m.city}\n`;
        if (m.country) text += `Country/Region: ${m.country}\n`;
        text += `Timezone: ${m.timezone}\n`;
        text += `Days until race: ${daysUntil > 0 ? daysUntil : 'Race has passed'}\n`;
        if (m.weather) {
          text += `\n### Race Day Weather\nTemperature: ${m.weather.avgTempC}°C / ${m.weather.avgTempF}°F\n`;
          text += `Humidity: ${m.weather.humidity}% | Wind: ${m.weather.windKmh} km/h | Rain: ${m.weather.precipPct}%\n`;
          text += `Conditions: ${m.weather.conditions}\n`;
        }
        if (m.course) {
          text += `\n### Course Profile\nType: ${m.course.type} | Elevation: ${m.course.elevationGain}m | Terrain: ${m.course.terrain}\n`;
          text += `${m.course.profile}\n`;
        }
        text += `\nPage: ${m.links.page}\nCountdown: ${m.links.countdown}\n`;
        return { content: [{ type: 'text', text }] };
      }
    );
  • index.js:176-210 (registration)
    Registration of get_marathon tool via server.tool(). Defines the tool name, description, and input schema (id: string) along with the async handler.
    // Tool: get_marathon
    server.tool(
      'get_marathon',
      'Get detailed information about a specific marathon including countdown and Schema.org data',
      { id: z.string().describe('Marathon ID or slug, e.g. "tokyo", "boston", "berlin2026", "kobe2026"') },
      async ({ id }) => {
        let data;
        try {
          data = await fetchJSON(`${BASE_URL}/api/marathons/${id}.json`);
        } catch {
          // Fallback: try slug without year for Tier 1 marathons
          const slug = id.replace(/\d{4}$/, '');
          data = await fetchJSON(`${BASE_URL}/api/marathons/${slug}.json`);
        }
        const m = data.marathon;
        const raceDate = new Date(m.date);
        const now = new Date();
        const daysUntil = Math.ceil((raceDate - now) / (1000 * 60 * 60 * 24));
        let text = `## ${m.name.en}\n\nDate: ${m.date}\nCity: ${m.city}\n`;
        if (m.country) text += `Country/Region: ${m.country}\n`;
        text += `Timezone: ${m.timezone}\n`;
        text += `Days until race: ${daysUntil > 0 ? daysUntil : 'Race has passed'}\n`;
        if (m.weather) {
          text += `\n### Race Day Weather\nTemperature: ${m.weather.avgTempC}°C / ${m.weather.avgTempF}°F\n`;
          text += `Humidity: ${m.weather.humidity}% | Wind: ${m.weather.windKmh} km/h | Rain: ${m.weather.precipPct}%\n`;
          text += `Conditions: ${m.weather.conditions}\n`;
        }
        if (m.course) {
          text += `\n### Course Profile\nType: ${m.course.type} | Elevation: ${m.course.elevationGain}m | Terrain: ${m.course.terrain}\n`;
          text += `${m.course.profile}\n`;
        }
        text += `\nPage: ${m.links.page}\nCountdown: ${m.links.countdown}\n`;
        return { content: [{ type: 'text', text }] };
      }
    );
  • Input schema for get_marathon: expects a single 'id' parameter (string) described as 'Marathon ID or slug, e.g. "tokyo", "boston", "berlin2026", "kobe2026"'.
    { id: z.string().describe('Marathon ID or slug, e.g. "tokyo", "boston", "berlin2026", "kobe2026"') },
    async ({ id }) => {
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions output includes countdown and Schema.org data, which is helpful, but it does not disclose if the operation is read-only, any side effects, authentication needs, or rate limits. For a simple data retrieval tool, this is minimal but adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence of 12 words, front-loading the purpose and including key output details. No redundancy or unnecessary content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 param, no output schema), the description adequately conveys the return content ('detailed information, countdown, Schema.org data'). It could be improved by noting the return format or error conditions, but it is largely sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage with a clear description of the 'id' parameter (Marathon ID or slug with examples). The description does not add extra meaning beyond what the schema provides, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('detailed information about a specific marathon'), and it adds distinguishing features like 'including countdown and Schema.org data', which differentiates it from sibling tools like list_marathons or marathon_countdown.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving details of a specific marathon via the required 'id' parameter, but it does not explicitly state when to use this tool over alternatives like list_marathons (for all) or marathon_countdown (for countdown only). No when-not or alternative guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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