Skip to main content
Glama

get_seismic_data

Retrieve recent seismic activity data for Portugal, including continental areas, Azores, and Madeira, to monitor earthquake occurrences.

Instructions

Obter dados sísmicos recentes

Input Schema

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

Implementation Reference

  • The handler function for get_seismic_data tool. Fetches seismic data from IPMA API for specified area, formats recent earthquakes (up to 10) into a markdown text response with details like time, location, magnitude, depth, coordinates.
    async getSeismicData(area) {
      try {
        let areaId;
        switch (area.toLowerCase()) {
          case "continent":
            areaId = 1;
            break;
          case "azores":
            areaId = 2;
            break;
          case "madeira":
            areaId = 3;
            break;
          default:
            areaId = 1;
        }
    
        const response = await fetch(`${this.baseUrl}/observation/seismic/${areaId}.json`);
        const data = await response.json();
    
        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`;
    
        const recentData = data.data.slice(0, 10);
        
        recentData.forEach((earthquake) => {
          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.js:60-73 (registration)
    Registration of the get_seismic_data tool in the ListTools response, including name, description, and input schema defining 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"
          }
        }
      }
    },
  • src/index.js:112-113 (registration)
    Dispatcher case in CallToolRequestSchema handler that routes get_seismic_data calls to the getSeismicData method with default area 'all'.
    case "get_seismic_data":
      return await this.getSeismicData(args?.area || "all");

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
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.