Tools for agents: Closest point on a 3D polyline

Project a point onto a 3D path and return exact nearest positions, segment parameters and squared distance.

Connect with MCP

{
  "mcpServers": {
    "super-agent-tools": {
      "url": "https://app.getsupers.com/sites/agent-polyline-nearest/mcp"
    }
  }
}
Streamable HTTP · No API key · Stateless

Use this URL in any client supporting remote Streamable HTTP MCP. Calls return structured JSON; inputs are processed without persistence.

Call nearest_polyline_point

Segments connect consecutive vertices in the supplied order; the path is open. To close a path, repeat its first vertex at the end. Indices are zero-based. A segment point is start + parameter*(end-start), with parameter in [0,1]; this is not normalized path length. Return all exactly tied nearest segments in index order, including shared vertices and overlaps. A zero-length segment is treated as a point with parameter 0 and is also listed in degenerate_segments. Squared Euclidean distance stays exact; ordinary distance is its square root and may be irrational. Inputs are integers or quoted decimal/fraction strings; JSON floats and booleans are rejected. Coordinates use one common Cartesian unit; no geographic, geodesic or curved-path interpretation is applied. Uses rational arithmetic and scans every segment; intended for small exact geometry tasks.

Input and output schemas
{
  "name": "nearest_polyline_point",
  "title": "Closest point on a 3D polyline",
  "description": "Project a 3D query onto each consecutive segment of an open polyline. Return every exactly tied nearest segment with rational coordinates and squared Euclidean distance.",
  "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"
      },
      "query": {
        "maxItems": 3,
        "minItems": 3,
        "prefixItems": [
          {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          }
        ],
        "title": "Query",
        "type": "array"
      }
    },
    "required": [
      "vertices",
      "query"
    ],
    "title": "nearest_polyline_pointArguments",
    "type": "object"
  },
  "outputSchema": {
    "additionalProperties": true,
    "title": "nearest_polyline_pointDictOutput",
    "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-polyline-nearest/call
Content-Type: application/json

{
  "vertices": [
    [
      0,
      0,
      0
    ],
    [
      4,
      0,
      0
    ],
    [
      4,
      4,
      0
    ]
  ],
  "query": [
    2,
    1,
    3
  ]
}

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.