Skip to main content
Glama

physics

Execute raycasts, spherecasts, and boxcasts, apply forces and torques, manage gravity, and step physics simulation in Unity.

Instructions

Unity Physics system control and queries. Actions:

  • raycast: Perform a raycast and return hit info

  • raycast_all: Raycast returning all hits

  • spherecast: Sphere-based raycast

  • boxcast: Box-based raycast

  • overlap_sphere: Find colliders in a sphere

  • overlap_box: Find colliders in a box

  • simulate: Step physics simulation manually

  • get_contacts: Get contact points between colliders

  • set_gravity: Set physics gravity

  • get_layer_collision: Get layer collision matrix

  • set_layer_collision: Set layer collision matrix

  • add_force: Add force to a Rigidbody

  • add_torque: Add torque to a Rigidbody

  • set_velocity: Set Rigidbody velocity

  • get_rigidbody_state: Get Rigidbody physics state

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoForce vector to apply
actionYesPhysics action to perform
layer1NoFirst layer index for collision matrix
layer2NoSecond layer index for collision matrix
originNoRay/query origin point
radiusNoRadius for sphere cast/overlap
collideNoWhether layers should collide
gravityNoNew gravity vector
objectIdNoInstance ID of the Rigidbody object
velocityNoVelocity vector to set
directionNoRay direction (will be normalized)
forceModeNoForce application mode
layerMaskNoLayer mask for filtering (default: all layers)
maxResultsNoMaximum results for multi-hit queries
objectPathNoHierarchy path of the Rigidbody object
halfExtentsNoHalf extents for box cast/overlap
maxDistanceNoMaximum raycast distance
orientationNoRotation quaternion for box queries
queryTriggersNoInclude trigger colliders
angularVelocityNoAngular velocity to set
simulationStepsNoNumber of physics simulation steps
Behavior2/5

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

The description names both read (raycast) and write (add_force) actions but does not expand on behavioral traits like side effects, permissions needed, or state persistence. Given readOnlyHint=false, the description could have added context about what modifications entail (e.g., gravity changes affect all objects). The lack of such detail limits transparency.

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 concise: one header sentence followed by a compact list of actions with one-line descriptions. It front-loads the purpose. However, the list format could be better structured (e.g., grouping reads vs writes). Still, no wasted words.

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

Completeness3/5

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

Given the tool's high complexity (21 parameters, 15 actions, no output schema), the description lacks information on return structures, error handling, or behavior of unmentioned combinations. The schema covers parameters well, but the description doesn't fully compensate for missing output schema or complex interactions.

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?

Input schema has 100% description coverage for all parameters. The tool description adds no additional parameter meaning beyond listing actions in the description, which maps to the action enum. Baseline of 3 applies because schema does the heavy lifting.

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 it controls Unity Physics system and lists 15 specific actions (raycast, simulate, add_force, etc.), distinguishing it from siblings like physics2d. The verb-resource pair is specific: 'Unity Physics system control and queries'.

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?

No explicit when-to-use or when-not-to-use guidance. The description lists actions but doesn't indicate which action to choose for a given scenario or when to use this tool over other physics-related tools (e.g., physics2d). The agent must infer usage from action names.

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/joel-wehr/unity-mcp'

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