Skip to main content
Glama

search_earthquakes_by_location

Find seismic activity near Swiss locations using coordinates. Filter earthquakes by radius, time period, and magnitude to monitor local geological events.

Instructions

Search for earthquakes near a geographic location using the Swiss Seismological Service (SED) FDSN API. Useful for finding seismic activity near a Swiss city, landmark, or custom coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYesLatitude of the center point (decimal degrees, e.g. 46.9 for Bern)
lonYesLongitude of the center point (decimal degrees, e.g. 7.5 for Bern)
radius_kmNoSearch radius in kilometres (default: 50, max: 500)
daysNoNumber of past days to search (default: 90, max: 365)
min_magnitudeNoMinimum magnitude filter (default: 0.5)
limitNoMaximum number of results to return (default: 20, max: 100)

Implementation Reference

  • The handler function that executes the search_earthquakes_by_location tool logic.
    async function handleSearchEarthquakesByLocation(
      args: Record<string, string | number>
    ): Promise<string> {
      const lat = Number(args.lat);
      const lon = Number(args.lon);
    
      if (isNaN(lat) || isNaN(lon)) {
        throw new Error("lat and lon must be valid numbers");
      }
    
      const radiusKm = Math.min(Number(args.radius_km ?? 50), 500);
      const days = Math.min(Number(args.days ?? 90), 365);
      const minMag = Number(args.min_magnitude ?? 0.5);
      const limit = Math.min(Number(args.limit ?? 20), 100);
    
      // SED FDSN uses maxradius in degrees, not km. Convert: 1 degree ≈ 111.12 km
      const maxRadiusDeg = radiusKm / 111.12;
    
      const url = buildUrl(BASE, {
        latitude: lat,
        longitude: lon,
        maxradius: maxRadiusDeg,
        starttime: startTimeISO(days),
        minmagnitude: minMag,
        limit: limit,
        format: "text",
        orderby: "time",
      });
    
      const raw = await fetchFdsnText(url);
    
      if (!raw) {
        return JSON.stringify({
          count: 0,
          events: [],
          center: { lat, lon },
          radius_km: radiusKm,
          days_searched: days,
          min_magnitude: minMag,
          limit,
          source: "Swiss Seismological Service (SED), ETH Zürich",
          note: "No events found near the given location.",
        });
      }
    
      const events = parseFdsnText(raw);
    
      return JSON.stringify({
        count: events.length,
        center: { lat, lon },
        radius_km: radiusKm,
        days_searched: days,
        min_magnitude: minMag,
        limit,
        source: "Swiss Seismological Service (SED), ETH Zürich",
        api: "FDSN Event Web Service — http://arclink.ethz.ch/fdsnws/event/1/",
        events,
      });
    }
  • Input schema definition for the search_earthquakes_by_location tool.
    name: "search_earthquakes_by_location",
    description:
      "Search for earthquakes near a geographic location using the Swiss Seismological Service (SED) FDSN API. " +
      "Useful for finding seismic activity near a Swiss city, landmark, or custom coordinates.",
    inputSchema: {
      type: "object",
      required: ["lat", "lon"],
      properties: {
        lat: {
          type: "number",
          description: "Latitude of the center point (decimal degrees, e.g. 46.9 for Bern)",
        },
        lon: {
          type: "number",
          description: "Longitude of the center point (decimal degrees, e.g. 7.5 for Bern)",
        },
        radius_km: {
          type: "number",
          description: "Search radius in kilometres (default: 50, max: 500)",
        },
        days: {
          type: "number",
          description: "Number of past days to search (default: 90, 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, max: 100)",
        },
      },
    },
  • Tool call dispatching/registration within the module handler.
    case "search_earthquakes_by_location":
      return handleSearchEarthquakesByLocation(args as Record<string, string | number>);
    default:
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the API source, it doesn't disclose important behavioral traits like rate limits, authentication requirements, error handling, response format, or whether this is a read-only operation. The description is insufficient for a tool with 6 parameters and no output schema.

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 efficiently structured in two sentences with zero waste. The first sentence states the core purpose and data source, while the second provides usage context. Every word earns its place, and the most important information is front-loaded.

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

Completeness2/5

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

For a tool with 6 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns (earthquake details, counts, or raw data), doesn't mention pagination or result ordering, and provides no information about error conditions or API limitations. The description should do more to compensate for the lack of structured metadata.

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 schema description coverage is 100%, so all parameters are well-documented in the schema itself. The description adds minimal value beyond the schema by mentioning 'Swiss city, landmark, or custom coordinates' which relates to lat/lon parameters, but doesn't provide additional semantic context about parameter interactions or usage patterns.

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 specific action ('Search for earthquakes near a geographic location'), identifies the resource ('earthquakes'), and specifies the data source ('Swiss Seismological Service (SED) FDSN API'). It distinguishes itself from sibling tools like 'get_recent_earthquakes' by emphasizing location-based filtering rather than recency.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool ('useful for finding seismic activity near a Swiss city, landmark, or custom coordinates'), which helps differentiate it from other earthquake-related tools. However, it doesn't explicitly mention when NOT to use it or name specific alternatives like 'get_recent_earthquakes' for non-location-based searches.

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