Skip to main content
Glama

get_seismic_data

Retrieve recent seismic activity data for Portugal, including mainland, Azores, and Madeira regions, to monitor earthquakes and assess geological events.

Instructions

Obter dados sísmicos recentes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
areaNoÁrea: 'continent', 'azores', 'madeira', ou 'all'all

Implementation Reference

  • The core handler function that maps the area parameter to IPMA seismic API endpoints, fetches recent earthquake data, formats the top 10 events with details like time, location, magnitude, depth, and coordinates into a markdown text response, and returns it in MCP format. Handles no-data case and errors.
    private async getSeismicData(area: string) {
      try {
        let areaId: number;
        switch (area.toLowerCase()) {
          case "continent":
            areaId = 1;
            break;
          case "azores":
            areaId = 2;
            break;
          case "madeira":
            areaId = 3;
            break;
          default:
            areaId = 1; // Default to continent
        }
    
        const response = await fetch(`${this.baseUrl}/observation/seismic/${areaId}.json`);
        const data = await response.json() as ApiResponse<SeismicData>;
    
        if (!data.data || data.data.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: "📍 Não há dados sísmicos recentes para a área especificada."
              }
            ]
          };
        }
    
        let result = `🌍 **Dados Sísmicos - ${area}**\n\n`;
        result += `🕐 Última atualização: ${data.data[0]?.dataUpdate}\n\n`;
    
        // Mostrar apenas os 10 mais recentes
        const recentData = data.data.slice(0, 10);
        
        recentData.forEach((earthquake: SeismicData) => {
          const eventTime = new Date(earthquake.time).toLocaleString('pt-PT');
          result += `📅 **${eventTime}**\n`;
          result += `📍 Local: ${earthquake.obsRegion || 'N/A'}\n`;
          result += `📏 Magnitude: ${earthquake.magnitud} ${earthquake.magType}\n`;
          result += `🌊 Profundidade: ${earthquake.depth} km\n`;
          result += `🗺️ Coordenadas: ${earthquake.lat}, ${earthquake.lon}\n\n`;
        });
    
        return {
          content: [
            {
              type: "text",
              text: result
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new McpError(ErrorCode.InternalError, `Erro ao obter dados sísmicos: ${errorMessage}`);
      }
    }
  • src/index.ts:159-172 (registration)
    Registration of the 'get_seismic_data' tool in the ListTools handler, including its description and input schema defining an optional 'area' parameter.
    {
      name: "get_seismic_data",
      description: "Obter dados sísmicos recentes",
      inputSchema: {
        type: "object",
        properties: {
          area: {
            type: "string",
            description: "Área: 'continent', 'azores', 'madeira', ou 'all'",
            default: "all"
          }
        }
      }
    },
  • TypeScript interface defining the structure of individual seismic event data from the IPMA API, used in the handler for type safety.
    interface SeismicData {
      degree: string | null;
      dataUpdate: string;
      magType: string;
      obsRegion: string;
      lon: string;
      source: string;
      depth: number;
      time: string;
      lat: string;
      local: string | null;
      magnitud: string;
    }
  • Dispatcher case in the central CallToolRequestSchema handler that invokes the specific getSeismicData method with the provided or default area argument.
    case "get_seismic_data":
      return await this.getSeismicData(toolArgs?.area || "all");
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. It states the tool retrieves data ('obter') which implies a read operation, but doesn't specify whether this requires authentication, has rate limits, returns real-time vs historical data, or what format/volume the data comes in. The 'recentes' qualifier suggests temporal recency but doesn't define the timeframe. For a data retrieval tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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

Conciseness4/5

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

The description is extremely concise - a single three-word phrase in Portuguese. While appropriately brief, it could benefit from slightly more context about what 'recent' means or what format the data returns. However, it's front-loaded with the essential action and resource, with no wasted words or redundant information.

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?

Given the tool's moderate complexity (data retrieval with geographic filtering), no annotations, and no output schema, the description is minimally adequate. It identifies the resource and action but leaves unanswered questions about data format, recency definition, authentication needs, and error conditions. The schema covers the single parameter well, but overall completeness is limited for a tool that presumably returns structured seismic data.

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 schema has 100% description coverage with a well-documented 'area' parameter including enum-like options and default value. The description doesn't add any parameter information beyond what's in the schema, but with only one parameter and complete schema documentation, this is acceptable. The baseline for 100% coverage with 1 parameter is appropriately high since the schema does all the work.

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

Purpose3/5

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

The description 'Obter dados sísmicos recentes' (Get recent seismic data) states a clear verb ('obter' - get) and resource ('dados sísmicos' - seismic data) with a temporal qualifier ('recentes' - recent). However, it doesn't distinguish this tool from potential siblings - while no direct seismic siblings exist, the agent might wonder about differences from geological or environmental data tools. The purpose is understandable but lacks differentiation context.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. There's no mention of what makes this seismic data tool appropriate compared to weather-related sibling tools (get_weather_forecast, get_weather_warnings) or location tools (get_locations). No prerequisites, constraints, or comparative context is provided to help the agent choose appropriately.

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/DiogoAzevedo03/ipma-mcp-server'

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