Skip to main content
Glama
Pradumnasaraf

Aviationstack MCP Server

list_taxes

Retrieve a paginated list of aviation taxes with optional text search to filter results.

Instructions

List aviation taxes with pagination and optional search.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of tax records to return.
offsetNoOffset for pagination.
searchNoOptional tax search text.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool registration for 'list_taxes' using @mcp.tool decorator. Defines the tool wrapper that validates input via ListTaxesInput and delegates to the core list_taxes function.
    @mcp.tool(
        name="list_taxes",
        description="List aviation taxes with pagination and optional search.",
    )
    def list_taxes_tool(
        limit: Annotated[
            int, Field(description="Maximum number of tax records to return.", gt=0)
        ] = 10,
        offset: Annotated[int, Field(description="Offset for pagination.", ge=0)] = 0,
        search: Annotated[str, Field(description="Optional tax search text.")] = "",
    ) -> str:
        """Tool wrapper for list_taxes."""
        validated_input = ListTaxesInput(limit=limit, offset=offset, search=search)
        return list_taxes(
            limit=validated_input.limit,
            offset=validated_input.offset,
            search=validated_input.search,
        )
  • Core handler for list_taxes. Validates limit/offset, builds params, calls _list_reference_data with 'taxes' endpoint and maps each tax to tax_id, tax_name, iata_code. Handles request and value errors.
    def list_taxes(limit: int = 10, offset: int = 0, search: str = "") -> str:
        """List aviation taxes (available on all plans)."""
        try:
            _validate_positive_int(limit, "limit")
            _validate_non_negative_int(offset, "offset")
            params: dict[str, Any] = {"limit": limit, "offset": offset}
            if search:
                params["search"] = search
    
            return _list_reference_data(
                "taxes",
                params,
                lambda tax: {
                    "tax_id": tax.get("tax_id"),
                    "tax_name": tax.get("tax_name"),
                    "iata_code": tax.get("iata_code"),
                },
            )
        except requests.RequestException as exc:
            return _error_response("fetching taxes", exc)
        except (KeyError, ValueError, TypeError) as exc:
            return _error_response("fetching taxes", exc)
  • Pydantic input schema ListTaxesInput with fields: limit (gt=0, default=10), offset (ge=0, default=0), search (default=''). Extra fields forbidden.
    class ListTaxesInput(BaseModel):
        """Input schema for list_taxes tool."""
    
        model_config = ConfigDict(extra="forbid")
    
        limit: int = Field(
            default=10,
            description="Maximum number of tax records to return.",
            gt=0,
        )
        offset: int = Field(
            default=0,
            description="Offset for pagination.",
            ge=0,
        )
        search: str = Field(
            default="",
            description="Optional tax search text.",
        )
  • Generic helper _list_reference_data used by list_taxes. Fetches data from Aviationstack API endpoint, applies a mapper function, and returns JSON string of the results.
    def _list_reference_data(
        endpoint: str,
        params: dict[str, Any],
        mapper: Callable[[dict[str, Any]], dict[str, Any]],
    ) -> str:
        data = fetch_flight_data(endpoint, params)
        return json.dumps([mapper(item) for item in data.get("data", [])])
  • Error response helper _error_response used by list_taxes to return a JSON error on request/value errors.
    def _error_response(context: str, exc: Exception) -> str:
        return json.dumps({"ok": False, "context": context, "error": str(exc)})
Behavior2/5

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

No annotations provided, and the description gives minimal behavioral disclosure. It does not mention read-only nature, error conditions, data freshness, rate limits, or any side effects beyond listing. Agents lack context on expectations.

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 a single, front-loaded sentence with no unnecessary words. It is concise and directly conveys the tool's core functionality.

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

Completeness4/5

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

The presence of an output schema reduces the need to explain return values. However, the description could mention sorting, default behavior, or data scope. Given the output schema, it is mostly complete but lacks minor context.

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?

Schema coverage is 100% with clear descriptions for limit, offset, and search. The description adds little beyond summarizing pagination and optional search, which is already inferable from the schema. No additional semantics are provided.

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 'List aviation taxes', specifying the verb and resource, and adds context about pagination and optional search, which distinguishes it from sibling list tools like 'list_airlines' and 'list_airports'.

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?

No guidance on when to use this tool versus alternatives, nor any mention of prerequisites, conditions for pagination, or when search is appropriate. The description is purely functional without usage context.

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