Tools for agents: Exact ray-mesh intersections
Find forward ray hits on triangle meshes, with exact positions, face indices and barycentric coordinates.
Connect with MCP
{
"mcpServers": {
"super-agent-tools": {
"url": "https://app.getsupers.com/sites/agent-ray-mesh/mcp"
}
}
}Use this URL in any client supporting remote Streamable HTTP MCP. Calls return structured JSON; inputs are processed without persistence.
Call intersect_ray_mesh
Ray equation: origin + t*direction, with t >= 0; direction need not be normalized. Parameter t is not Euclidean distance. Send integers or quoted decimal/fraction strings; JSON floats and booleans are rejected. Both face sides are tested. Edge, vertex and t=0 hits are included; shared-edge or overlapping-face hits remain separate per-face records. Barycentric weights correspond to the three vertex indices in each face. front_facing means the ray direction opposes the face normal from its index order. Degenerate triangles are reported and skipped. A ray in a triangle plane is reported as coplanar even if it misses the triangle; coplanar overlap is not resolved. isolated_hits_complete is false whenever coplanar faces exist; nearest_hit is only the nearest reported isolated hit. Empty hits alone do not prove no coplanar overlap. This is a linear scan for small meshes, not a spatially accelerated renderer or solid-containment test. Rational arithmetic: https://docs.python.org/3/library/fractions.html
Input and output schemas
{
"name": "intersect_ray_mesh",
"title": "Exact ray-mesh intersections",
"description": "Intersect a forward ray origin+t*direction, t>=0, with both sides of indexed triangles. Return exact fraction-string hits sorted by ray parameter; flag degenerate and coplanar faces separately.",
"inputSchema": {
"properties": {
"vertices": {
"items": {
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"type": "array"
},
"title": "Vertices",
"type": "array"
},
"triangles": {
"items": {
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"type": "integer"
},
{
"type": "integer"
},
{
"type": "integer"
}
],
"type": "array"
},
"title": "Triangles",
"type": "array"
},
"origin": {
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"title": "Origin",
"type": "array"
},
"direction": {
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"title": "Direction",
"type": "array"
}
},
"required": [
"vertices",
"triangles",
"origin",
"direction"
],
"title": "intersect_ray_meshArguments",
"type": "object"
},
"outputSchema": {
"additionalProperties": true,
"title": "intersect_ray_meshDictOutput",
"type": "object"
},
"icons": null,
"annotations": {
"title": null,
"readOnlyHint": true,
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": false
},
"meta": null,
"execution": null
}Run the example to see the actual result.
HTTP alternative
POST https://app.getsupers.com/sites/agent-ray-mesh/call
Content-Type: application/json
{
"vertices": [
[
0,
0,
0
],
[
2,
0,
0
],
[
0,
2,
0
]
],
"triangles": [
[
0,
1,
2
]
],
"origin": [
"1/2",
"1/2",
2
],
"direction": [
0,
0,
-2
]
}The HTTP and MCP interfaces execute the same implementation. Validation errors are returned explicitly. See the tool notes above for its supported inputs and behavior.