Skip to main content
Glama
Pradumnasaraf

Aviationstack MCP Server

random_aircraft_type

Fetch random aircraft type records by specifying the number of aircraft types to retrieve.

Instructions

Return random aircraft type records.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
number_of_aircraftYesNumber of random aircraft types to return.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler function that fetches random aircraft types from the API, samples them, and returns JSON with aircraft_name and iata_code.
    def random_aircraft_type(number_of_aircraft: int) -> str:
        """Get random aircraft types."""
        try:
            _validate_positive_int(number_of_aircraft, "number_of_aircraft")
            data = fetch_flight_data("aircraft_types", {"limit": number_of_aircraft})
            sampled_aircraft_types = _sample_data(data.get("data", []), number_of_aircraft)
    
            aircraft_types = []
            for aircraft_type in sampled_aircraft_types:
                aircraft_types.append(
                    {
                        "aircraft_name": aircraft_type.get("aircraft_name"),
                        "iata_code": aircraft_type.get("iata_code"),
                    }
                )
            return json.dumps(aircraft_types)
        except requests.RequestException as exc:
            return _error_response("fetching aircraft type", exc)
        except (KeyError, ValueError, TypeError) as exc:
            return _error_response("fetching aircraft type", exc)
  • Pydantic input schema (RandomAircraftTypeInput) validating the number_of_aircraft parameter (must be > 0).
    class RandomAircraftTypeInput(BaseModel):
        """Input schema for random_aircraft_type tool."""
    
        model_config = ConfigDict(extra="forbid")
    
        number_of_aircraft: int = Field(
            ...,
            description="Number of random aircraft types to return.",
            gt=0,
        )
  • MCP tool registration: @mcp.tool decorator registering the tool as 'random_aircraft_type' with a description.
    @mcp.tool(
        name="random_aircraft_type",
        description="Return random aircraft type records.",
    )
    def random_aircraft_type_tool(
        number_of_aircraft: Annotated[
            int, Field(description="Number of random aircraft types to return.", gt=0)
        ],
    ) -> str:
        """Tool wrapper for random_aircraft_type."""
        validated_input = RandomAircraftTypeInput(number_of_aircraft=number_of_aircraft)
        return random_aircraft_type(number_of_aircraft=validated_input.number_of_aircraft)
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states 'Return random aircraft type records' without detailing any behavioral traits like source of randomness, sampling method, or potential side effects. This is severely lacking for a random data tool.

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 a single, clear sentence with no wasted words. It is appropriately sized for a simple tool, though it could benefit from minor expansions on usage.

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 simplicity and presence of an output schema, the description should at least hint at randomness behavior or expected output format. It lacks completeness for a random generator tool.

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

Parameters2/5

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

Schema description coverage is 100%, but the tool description adds no additional meaning beyond what the schema already provides ('Number of random aircraft types to return'). The description merely restates the parameter's purpose without enrichment.

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 'Return random aircraft type records' clearly states the verb (Return) and resource (random aircraft type records). It distinctly differentiates from sibling tools like flight_arrival_departure_schedule or list_airlines, which do not return random aircraft types.

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 context about when to use this tool versus alternatives. No mention of when not to use it or any prerequisites. It leaves the agent without guidance on appropriate usage scenarios.

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/Pradumnasaraf/aviationstack-mcp'

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