Tools for agents: Exact triangle barycentric coordinates
Compute triangle interpolation weights with exact projection coordinates and explicit plane and boundary classification.
Connect with MCP
{
"mcpServers": {
"super-agent-tools": {
"url": "https://app.getsupers.com/sites/agent-barycentric/mcp"
}
}
}Use this URL in any client supporting remote Streamable HTTP MCP. Calls return structured JSON; inputs are processed without persistence.
Call triangle_barycentric
Triangle vertices are ordered A,B,C; weights are [alpha,beta,gamma] and always sum to one. They reconstruct the orthogonal projection onto the infinite triangle plane, including for points off the plane. Negative weights are allowed and indicate a projection outside the closed triangle. Classification is off_plane whenever squared_plane_distance is nonzero; otherwise inside means all weights positive, boundary means all nonnegative with at least one zero, and outside means at least one negative. Vertices count as boundary. point_in_closed_triangle includes edges and requires exact coplanarity; projection_in_closed_triangle tests only the projected point. Inputs are integers or quoted finite decimal/fraction strings; JSON floats and booleans are rejected. Degenerate triangles fail, including collinear or repeated vertices. Empty point lists are allowed. Results use exact rationals with no tolerance. This is not the nearest point on a bounded triangle when the projection lies outside, and it does not clamp weights, infer units or perform perspective-correct interpolation.
Input and output schemas
{
"name": "triangle_barycentric",
"title": "Exact triangle barycentric coordinates",
"description": "Compute exact barycentric weights on the plane of a nondegenerate 3D triangle, projected points and separate plane/triangle membership.",
"inputSchema": {
"properties": {
"points": {
"items": {
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"type": "array"
},
"title": "Points",
"type": "array"
},
"triangle": {
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"type": "array"
},
{
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"type": "array"
},
{
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
{
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
}
],
"type": "array"
}
],
"title": "Triangle",
"type": "array"
}
},
"required": [
"points",
"triangle"
],
"title": "triangle_barycentricArguments",
"type": "object"
},
"outputSchema": {
"additionalProperties": true,
"title": "triangle_barycentricDictOutput",
"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-barycentric/call
Content-Type: application/json
{
"triangle": [
[
0,
0,
0
],
[
2,
0,
0
],
[
0,
2,
0
]
],
"points": [
[
"1/2",
"1/2",
0
],
[
1,
1,
0
],
[
1,
1,
2
],
[
3,
0,
0
]
]
}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.