Skip to main content
Glama

get_atmosphere_profile

Calculate atmospheric pressure, temperature, and density at specified altitudes using International Standard Atmosphere models for flight planning and aerospace analysis.

Instructions

Get atmospheric properties (pressure, temperature, density) at specified altitudes using ISA model.

Args: altitudes_m: List of altitudes in meters model_type: Atmospheric model type ('ISA' for standard, 'enhanced' for extended)

Returns: Formatted string with atmospheric profile data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
altitudes_mYes
model_typeNoISA

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function registered as MCP tool. It calls the core implementation, formats the output as a readable table with JSON, and handles errors.
    def get_atmosphere_profile(
        altitudes_m: list[float], model_type: Literal["ISA", "enhanced"] = "ISA"
    ) -> str:
        """Get atmospheric properties (pressure, temperature, density) at specified altitudes using ISA model.
    
        Args:
            altitudes_m: List of altitudes in meters
            model_type: Atmospheric model type ('ISA' for standard, 'enhanced' for extended)
    
        Returns:
            Formatted string with atmospheric profile data
        """
        try:
            from ..integrations.atmosphere import get_atmosphere_profile as _get_profile
    
            profile = _get_profile(altitudes_m, model_type)
    
            # Format response
            result_lines = [f"Atmospheric Profile ({model_type})", "=" * 50]
            result_lines.append(
                f"{'Alt (m)':>8} {'Press (Pa)':>12} {'Temp (K)':>9} {'Density':>10} {'Sound (m/s)':>12}"
            )
            result_lines.append("-" * 60)
    
            for point in profile:
                result_lines.append(
                    f"{point.altitude_m:8.0f} {point.pressure_pa:12.1f} {point.temperature_k:9.2f} "
                    f"{point.density_kg_m3:10.6f} {point.speed_of_sound_mps:12.1f}"
                )
    
            # Add JSON data for programmatic use
            json_data = json.dumps([p.model_dump() for p in profile], indent=2)
            result_lines.extend(["", "JSON Data:", json_data])
    
            return "\n".join(result_lines)
    
        except ImportError:
            return "Atmospheric modeling not available - install with: pip install ambiance"
        except Exception as e:
            logger.error(f"Atmosphere profile error: {str(e)}", exc_info=True)
            return f"Atmosphere profile error: {str(e)}"
  • Registration of the get_atmosphere_profile tool using FastMCP's mcp.tool().
    # Atmospheric tools
    mcp.tool(get_atmosphere_profile)
    mcp.tool(wind_model_simple)
  • Pydantic BaseModel defining the structure of each atmosphere data point returned by the core function.
    class AtmospherePoint(BaseModel):
        """Single atmosphere condition point."""
    
        altitude_m: float = Field(..., description="Geometric altitude in meters")
        pressure_pa: float = Field(..., description="Static pressure in Pascals")
        temperature_k: float = Field(..., description="Temperature in Kelvin")
        density_kg_m3: float = Field(..., description="Air density in kg/m³")
        speed_of_sound_mps: float = Field(..., description="Speed of sound in m/s")
        viscosity_pa_s: float | None = Field(None, description="Dynamic viscosity in Pa·s")
  • Core implementation that performs the actual atmosphere calculations using the 'ambiance' library or a manual ISA model fallback.
    def get_atmosphere_profile(
        altitudes_m: list[float], model_type: str = "ISA"
    ) -> list[AtmospherePoint]:
        """
        Get atmospheric properties at specified altitudes.
    
        Args:
            altitudes_m: List of geometric altitudes in meters (0-81020m when using ambiance, 0-86000m for manual ISA)
            model_type: Atmosphere model ("ISA", "COESA") - currently only ISA supported
    
        Returns:
            List of AtmospherePoint objects with pressure, temperature, density, etc.
        """
        if model_type not in ["ISA", "COESA"]:
            raise ValueError(f"Unknown model type: {model_type}. Use 'ISA' or 'COESA'")
    
        results = []
    
        for altitude in altitudes_m:
            # Use appropriate limits based on availability of ambiance library
            max_altitude = 81020 if AMBIANCE_AVAILABLE else 86000
            if altitude < 0 or altitude > max_altitude:
                range_str = f"0-{max_altitude}m"
                raise ValueError(f"Altitude {altitude}m out of ISA range ({range_str})")
    
            if AMBIANCE_AVAILABLE and model_type == "ISA":
                # Use ambiance library if available
                atm = ambiance.Atmosphere(altitude)
                point = AtmospherePoint(
                    altitude_m=altitude,
                    pressure_pa=float(atm.pressure),
                    temperature_k=float(atm.temperature),
                    density_kg_m3=float(atm.density),
                    speed_of_sound_mps=float(atm.speed_of_sound),
                    viscosity_pa_s=(
                        float(atm.dynamic_viscosity)
                        if hasattr(atm, "dynamic_viscosity")
                        else None
                    ),
                )
            else:
                # Fall back to manual calculation
                pressure, temperature, density = _isa_manual(altitude)
                speed_of_sound = math.sqrt(GAMMA * R_SPECIFIC * temperature)
    
                point = AtmospherePoint(
                    altitude_m=altitude,
                    pressure_pa=pressure,
                    temperature_k=temperature,
                    density_kg_m3=density,
                    speed_of_sound_mps=speed_of_sound,
                    viscosity_pa_s=None,  # Not calculated in manual mode
                )
    
            results.append(point)
    
        return results
  • Tool schema reference used by agent functions for input parameter descriptions and examples.
    ToolReference(
        name="get_atmosphere_profile",
        description="Calculate atmospheric conditions at various altitudes",
        parameters={
            "altitudes_m": "List[float] - List of altitudes in meters",
            "model_type": "Literal['isa', 'enhanced'] - Atmospheric model type (default 'isa')",
        },
        examples=[
            "get_atmosphere_profile([0, 1000, 5000, 10000])",
            'get_atmosphere_profile([0, 2000, 4000, 6000, 8000, 10000], "enhanced")',
        ],
    ),
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the model types ('ISA' and 'enhanced') and the return format ('Formatted string'), but lacks details on computational limits, error handling, or what 'enhanced' entails beyond the basic ISA model. It adequately describes the core operation but misses deeper behavioral context.

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 efficiently structured with a clear purpose statement, followed by labeled sections for Args and Returns. Each sentence serves a distinct purpose without redundancy, making it easy to parse and understand the tool's functionality quickly.

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?

Given the tool's moderate complexity (2 parameters, no annotations, but with an output schema), the description is reasonably complete. It covers the purpose, parameters, and return format. The output schema handles return values, so the description need not detail them further. However, it could benefit from more context on model differences or usage scenarios.

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 description coverage is 0%, so the description must compensate. It explains that 'altitudes_m' is a list of altitudes in meters and 'model_type' specifies the atmospheric model with options 'ISA' for standard and 'enhanced' for extended. This adds meaningful semantics beyond the bare schema, though it could elaborate on valid altitude ranges or 'enhanced' model specifics.

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 the specific action ('Get atmospheric properties'), the resources involved ('pressure, temperature, density'), and the method ('using ISA model'). It distinguishes itself from sibling tools by focusing on atmospheric profile calculation rather than orbital mechanics, aircraft performance, or other aerospace domains.

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

Usage Guidelines3/5

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

The description implies usage context through the mention of 'ISA model' and 'enhanced' options, suggesting this is for standard or extended atmospheric calculations. However, it provides no explicit guidance on when to use this tool versus alternatives like 'wind_model_simple' or 'get_aircraft_performance', nor does it mention prerequisites or exclusions.

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/cheesejaguar/aerospace-mcp'

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