Skip to main content
Glama
mcgiverdev

MCP API Server

by mcgiverdev

obtener-clima

Retrieve current weather data for any specified city using this API tool. Get temperature, conditions, and forecasts to integrate weather information into applications or workflows.

Instructions

Herramienta para obtener clima

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYesCiudad para obtener el clima

Implementation Reference

  • The main handler function for the "obtener-clima" tool. It extracts the city from params, fetches weather data using getWeather service, and returns a formatted MCP response.
    export async function weatherToolHandler(params: any) {
      const { city } = params;
      
      // Utilizamos el servicio de clima
      const weatherData = await getWeather(city);
      
      // Devolvemos el resultado formateado para MCP
      return {
        content: [
          {
            type: "text" as const,
            text: `El clima en ${weatherData.city} es ${weatherData.condition} con una temperatura de ${weatherData.temperature}.`
          }
        ]
      };
    }
  • Input schema for the "obtener-clima" tool, defining the required 'city' parameter using Zod.
    export const weatherInputSchema = {
      city: z.string().describe("Ciudad para obtener el clima")
    };
  • src/main.ts:24-31 (registration)
    Registration of the "obtener-clima" tool in the MCP server, linking the name, description, input schema, and handler.
    server.registerTool(
      "obtener-clima",
      {
        description: "Herramienta para obtener clima",
        inputSchema: weatherInputSchema
      },
      weatherToolHandler
    );
  • Helper function that provides mock weather data for a given city, used by the tool handler.
    export async function getWeather(city: string): Promise<WeatherData> {
      // En un caso real, aquí se haría una llamada a una API de clima
      // Por ahora, devolvemos datos estáticos
      return {
        city,
        temperature: "25°C",
        condition: "soleado"
      };
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states the basic purpose without any behavioral traits such as data source, accuracy, rate limits, authentication needs, or error handling. It fails to disclose critical aspects like whether it's a read-only operation, what happens with invalid inputs, or response format.

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 with a single Spanish phrase 'Herramienta para obtener clima'. It's front-loaded and wastes no words, but this brevity comes at the cost of under-specification. While efficient, it lacks the necessary detail for a tool description, making it more of a label than a helpful guide.

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?

Given the tool's moderate complexity (a weather retrieval function with one parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what weather data is returned, how to interpret results, or any behavioral context. The schema covers the parameter, but the overall tool behavior remains poorly documented, leaving significant gaps for an AI agent.

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% description coverage, with the single parameter 'city' clearly documented in the schema as 'Ciudad para obtener el clima'. The description adds no additional meaning beyond this, as it doesn't elaborate on parameter usage, constraints, or examples. With high schema coverage, the baseline score of 3 is appropriate since the schema handles the parameter documentation adequately.

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

Purpose2/5

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

The description 'Herramienta para obtener clima' is a tautology that essentially restates the tool name 'obtener-clima' in Spanish. It provides the basic verb+resource ('obtener clima'), but lacks specificity about what aspect of weather is retrieved (e.g., current conditions, forecast, temperature) and doesn't differentiate from sibling tools, which are unrelated business/user management tools.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention any context, prerequisites, or exclusions. Given the sibling tools are unrelated (e.g., 'crear-empresa', 'listar-usuarios'), there's no implied usage relationship, leaving the agent with no information about appropriate scenarios for this weather tool.

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/mcgiverdev/mcp-api-v1'

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