Skip to main content
Glama

get_recent_earthquakes

Retrieve seismic events in Switzerland from the Swiss Seismological Service. Filter by date range, magnitude, and event type to access earthquake data.

Instructions

Get recent seismic events in and around Switzerland from the Swiss Seismological Service (SED) at ETH Zürich. Returns earthquakes and optionally quarry blasts, sorted by most recent first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of past days to search (default: 30, max: 365)
min_magnitudeNoMinimum magnitude filter (default: 0.5)
limitNoMaximum number of results to return (default: 20)
include_blastsNoInclude quarry blasts in results (default: false — earthquakes only)

Implementation Reference

  • The handler function that implements the logic for get_recent_earthquakes, fetching and processing earthquake data from the SED service.
    async function handleGetRecentEarthquakes(
      args: Record<string, string | number | boolean>
    ): Promise<string> {
      const days = Math.min(Number(args.days ?? 30), 365);
      const minMag = Number(args.min_magnitude ?? 0.5);
      const limit = Number(args.limit ?? 20);
      const includeBlasts = args.include_blasts === true || args.include_blasts === "true";
    
      const url = buildUrl(BASE, {
        starttime: startTimeISO(days),
        minmagnitude: minMag,
        limit: limit,
        format: "text",
        orderby: "time",
      });
    
      const raw = await fetchFdsnText(url);
    
      if (!raw) {
        return JSON.stringify({
          count: 0,
          events: [],
          source: "Swiss Seismological Service (SED), ETH Zürich",
          note: "No events found for the given criteria.",
        });
      }
    
      let events = parseFdsnText(raw);
    
      // Filter out quarry blasts unless explicitly requested
      if (!includeBlasts) {
        events = events.filter((e) => e.event_type.toLowerCase() !== "quarry blast");
      }
    
      const result = JSON.stringify({
        count: events.length,
        days_searched: days,
        min_magnitude: minMag,
        include_blasts: includeBlasts,
        source: "Swiss Seismological Service (SED), ETH Zürich",
        api: "FDSN Event Web Service — http://arclink.ethz.ch/fdsnws/event/1/",
        events,
      });
    
      if (result.length > 50000) {
        // Trim to stay under 50K
        const trimmed = events.slice(0, Math.max(1, Math.floor(events.length * 0.8)));
        return JSON.stringify({
          count: trimmed.length,
          truncated: true,
          days_searched: days,
          min_magnitude: minMag,
          include_blasts: includeBlasts,
          source: "Swiss Seismological Service (SED), ETH Zürich",
          api: "FDSN Event Web Service — http://arclink.ethz.ch/fdsnws/event/1/",
          events: trimmed,
        });
      }
    
      return result;
    }
  • The schema definition for get_recent_earthquakes, defining its name, description, and input parameters.
    {
      name: "get_recent_earthquakes",
      description:
        "Get recent seismic events in and around Switzerland from the Swiss Seismological Service (SED) at ETH Zürich. " +
        "Returns earthquakes and optionally quarry blasts, sorted by most recent first.",
      inputSchema: {
        type: "object",
        properties: {
          days: {
            type: "number",
            description: "Number of past days to search (default: 30, max: 365)",
          },
          min_magnitude: {
            type: "number",
            description: "Minimum magnitude filter (default: 0.5)",
          },
          limit: {
            type: "number",
            description: "Maximum number of results to return (default: 20)",
          },
          include_blasts: {
            type: "boolean",
            description: "Include quarry blasts in results (default: false — earthquakes only)",
          },
        },
      },
    },
  • The registration/dispatching logic that links the tool name "get_recent_earthquakes" to the handler function.
    case "get_recent_earthquakes":
      return handleGetRecentEarthquakes(args);
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that results are sorted by most recent first and mentions the optional inclusion of quarry blasts, but doesn't cover important behavioral aspects like rate limits, authentication requirements, error handling, or response format. The description doesn't contradict any annotations since none exist.

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 perfectly concise with two sentences that efficiently convey purpose, source, sorting behavior, and optional features. Every word serves a purpose with no redundancy or unnecessary elaboration.

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

Completeness3/5

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

For a read-only data retrieval tool with 4 well-documented parameters but no output schema, the description is adequate but could be more complete. It explains what data is retrieved and basic filtering options, but doesn't describe the response structure, data fields returned, or potential limitations beyond what's in the parameter descriptions.

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

Parameters4/5

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

The input schema has 100% description coverage, providing default values and constraints for all 4 parameters. The description adds value by explaining the overall purpose of filtering ('recent seismic events') and specifically mentioning the quarry blast inclusion option, which gives context beyond the schema's technical specifications.

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 recent seismic events'), specifies the resource ('from the Swiss Seismological Service at ETH Zürich'), and defines the scope ('in and around Switzerland'). It distinguishes from sibling tools like 'get_earthquake_details' and 'search_earthquakes_by_location' by focusing on recent events without location filtering.

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 recent seismic data, but doesn't explicitly state when to use this tool versus alternatives like 'get_earthquake_details' (for specific events) or 'search_earthquakes_by_location' (for location-based filtering). It mentions optional inclusion of quarry blasts, which provides some context for when to use this feature.

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/vikramgorla/mcp-swiss'

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