Skip to main content
Glama
IBM

Physics MCP Server

by IBM

check_collision

Predict if two moving spheres will collide and calculate when and where the impact occurs using analytic relative motion analysis.

Instructions

Check if two moving spherical objects will collide.

Predicts whether two moving spheres will collide within a time window,
and if so, calculates when and where the collision occurs. Uses analytic
relative motion to find exact collision time (if any).

Args:
    body1_position: Position of first object [x, y, z] in meters
    body1_velocity: Velocity of first object [x, y, z] in m/s
    body1_radius: Radius of first object in meters (must be positive)
    body2_position: Position of second object [x, y, z] in meters
    body2_velocity: Velocity of second object [x, y, z] in m/s
    body2_radius: Radius of second object in meters (must be positive)
    max_time: Maximum time to check in seconds. Default 10.0.

Returns:
    CollisionCheckResponse containing:
        - will_collide: True if collision will occur
        - collision_time: Time until collision in seconds (if collision occurs)
        - collision_point: Approximate collision location [x, y, z] (if collision occurs)
        - impact_speed: Relative velocity at impact in m/s (if collision occurs)
        - closest_approach_distance: Minimum distance between objects
        - closest_approach_time: Time of closest approach

Tips for LLMs:
    - Objects are modeled as spheres (point masses with radius)
    - Collision detection is exact for constant velocity motion
    - Returns earliest collision time if multiple intersections
    - If no collision, check closest_approach_distance to see how close they get
    - Use for: asteroid tracking, car crash prediction, sports ball interactions
    - For complex shapes or forces, use create_simulation instead

Example:
    # Check if two cars will collide
    result = await check_collision(
        body1_position=[0.0, 0.0, 0.0],
        body1_velocity=[10.0, 0.0, 0.0],
        body1_radius=2.0,
        body2_position=[50.0, 1.0, 0.0],
        body2_velocity=[-8.0, 0.0, 0.0],
        body2_radius=2.0
    )
    if result.will_collide:
        print(f"Collision in {result.collision_time:.2f} seconds at {result.impact_speed:.1f} m/s")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
body1_positionYes
body1_velocityYes
body1_radiusYes
body2_positionYes
body2_velocityYes
body2_radiusYes
max_timeNo
Behavior5/5

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

With no annotations provided, the description carries the full burden and excels by disclosing key behavioral traits: it explains the modeling approach ('Objects are modeled as spheres'), assumptions ('constant velocity motion'), exactness of detection, handling of multiple collisions ('Returns earliest collision time'), fallback behavior ('If no collision, check closest_approach_distance'), and practical applications. This covers critical aspects like what the tool does, how it works, and what to expect.

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 well-structured and front-loaded with the core purpose, followed by organized sections (Args, Returns, Tips, Example). Every sentence adds value, such as clarifying assumptions, usage contexts, and practical examples, with no redundant or wasted content.

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

Completeness5/5

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

For a tool with 7 parameters, no annotations, and no output schema, the description is exceptionally complete. It explains the tool's purpose, parameters, return values (detailed in 'Returns' section), behavioral nuances, usage guidelines, and includes an example. This provides all necessary context for an AI agent to use the tool effectively.

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?

Given 0% schema description coverage, the description fully compensates by detailing all 7 parameters in the 'Args' section, including their meanings, units (meters, m/s, seconds), constraints (e.g., 'must be positive'), and defaults ('Default 10.0'). It adds substantial value beyond the bare schema, ensuring parameters are well-understood.

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 tool's purpose with specific verbs ('check', 'predicts', 'calculates') and resources ('two moving spherical objects'), and distinguishes it from sibling tools like 'create_simulation' for complex scenarios. It explicitly mentions what it does: predicting collisions within a time window and calculating collision details.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool (e.g., 'Use for: asteroid tracking, car crash prediction, sports ball interactions') and when to use alternatives ('For complex shapes or forces, use create_simulation instead'). It also includes tips for LLMs that clarify the tool's scope and limitations.

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