Skip to main content
Glama
IBM

Physics MCP Server

by IBM

calculate_banking_angle

Compute the ideal banking angle for a curve given speed and radius, ensuring no friction is needed to maintain the turn.

Instructions

Calculate ideal banking angle: θ = arctan(v² / (rg)).

For a banked curve, the ideal angle where no friction is needed
to maintain the turn at a given speed.

Args:
    velocity: Speed in m/s
    radius: Turn radius in meters
    gravity: Gravitational acceleration in m/s² (default 9.81)

Returns:
    Dict containing:
        - angle_radians: Banking angle in radians
        - angle_degrees: Banking angle in degrees

Tips for LLMs:
    - Faster speed → steeper banking angle
    - Tighter turn → steeper banking angle
    - NASCAR tracks banked ~30° for high-speed turns
    - At ideal angle, normal force provides all centripetal force

Example - Highway exit ramp:
    result = await calculate_banking_angle(
        velocity=25,  # m/s (90 km/h)
        radius=100  # meter radius turn
    )
    # θ ≈ 32.5°

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
velocityYes
radiusYes
gravityNo

Implementation Reference

  • Core implementation of calculate_banking_angle. Computes the ideal banking angle using θ = arctan(v² / (r*g)). Returns both radians and degrees.
    def calculate_banking_angle(request: BankingAngleRequest) -> BankingAngleResponse:
        """Calculate ideal banking angle for a turn: θ = arctan(v² / (rg)).
    
        Args:
            request: Banking angle request
    
        Returns:
            Banking angle in radians and degrees
        """
        v = request.velocity
        r = request.radius
        g = request.gravity
    
        # θ = arctan(v² / (rg))
        theta_rad = math.atan((v * v) / (r * g))
        theta_deg = math.degrees(theta_rad)
    
        return BankingAngleResponse(angle_radians=theta_rad, angle_degrees=theta_deg)
  • BankingAngleRequest Pydantic model with velocity, radius, and gravity fields.
    class BankingAngleRequest(BaseModel):
        """Request for banking angle calculation."""
    
        velocity: float = Field(..., description="Velocity in m/s", gt=0.0)
        radius: float = Field(..., description="Radius of turn in meters", gt=0.0)
        gravity: float = Field(default=9.81, description="Gravitational acceleration in m/s²", gt=0.0)
  • BankingAngleResponse Pydantic model with angle_radians and angle_degrees fields.
    class BankingAngleResponse(BaseModel):
        """Response for banking angle calculation."""
    
        angle_radians: float = Field(..., description="Banking angle in radians")
        angle_degrees: float = Field(..., description="Banking angle in degrees")
  • MCP tool-decorated async wrapper for calculate_banking_angle. Acts as the public endpoint, validates via BankingAngleRequest, delegates to core calculate_banking_angle, and returns dict.
    @tool  # type: ignore[arg-type]
    async def calculate_banking_angle(
        velocity: float,
        radius: float,
        gravity: float = 9.81,
    ) -> dict:
        """Calculate ideal banking angle: θ = arctan(v² / (rg)).
    
        For a banked curve, the ideal angle where no friction is needed
        to maintain the turn at a given speed.
    
        Args:
            velocity: Speed in m/s
            radius: Turn radius in meters
            gravity: Gravitational acceleration in m/s² (default 9.81)
    
        Returns:
            Dict containing:
                - angle_radians: Banking angle in radians
                - angle_degrees: Banking angle in degrees
    
        Tips for LLMs:
            - Faster speed → steeper banking angle
            - Tighter turn → steeper banking angle
            - NASCAR tracks banked ~30° for high-speed turns
            - At ideal angle, normal force provides all centripetal force
    
        Example - Highway exit ramp:
            result = await calculate_banking_angle(
                velocity=25,  # m/s (90 km/h)
                radius=100  # meter radius turn
            )
            # θ ≈ 32.5°
        """
        from ..circular_motion import BankingAngleRequest, calculate_banking_angle as calc_bank
    
        request = BankingAngleRequest(
            velocity=velocity,
            radius=radius,
            gravity=gravity,
        )
        response = calc_bank(request)
        return response.model_dump()
  • Registration: server.py imports tools.circular_motion module which triggers @tool decorator registration of the calculate_banking_angle endpoint.
    # Import all tools modules to register their @tool decorated functions
    from .tools import (
        basic,
        rotational,
        oscillations,
        circular_motion,
        collisions,
        conservation,
        fluid as fluid_tools,
        kinematics_tools,
        statics,
        convert_units as unit_conversion_tools,
    )
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: it calculates the ideal banking angle using the given formula and returns a dict with angle in radians and degrees. It explains the physics concept and includes practical tips, leaving no ambiguity about the tool's operation.

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 well-structured with sections for formula, args, returns, tips, and an example. It is somewhat lengthy but each part adds value. Minor redundancy in the formula repetition could be trimmed.

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 simple input schema and no output schema, the description provides adequate coverage: formula, parameter explanations, return structure, and a concrete example. It does not discuss edge cases (e.g., invalid inputs) but this is acceptable for a straightforward physics calculator.

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

Parameters5/5

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

The input schema has 0% description coverage, so the description must and does provide full semantics: velocity in m/s, radius in meters, gravity in m/s² with default 9.81. This adds critical meaning beyond the bare schema types.

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 'Calculate ideal banking angle' and provides the formula θ = arctan(v² / (rg)). It is specific to banking angle calculation, distinguishing it from sibling tools that handle other physics computations.

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 does not explicitly state when to use this tool versus alternatives. While it provides tips and an example, it lacks comparative guidance with sibling tools for similar calculations (e.g., centripetal force). Usage context is implied but not clearly delineated.

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/IBM/chuk-mcp-physics'

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