Skip to main content
Glama

segment_intersection

Calculates all pairwise intersection points among 2D line segments, helping detect crossings and overlaps in geometry data.

Instructions

Find all pairwise intersections among a set of 2D line segments, returning intersection points.

Input Schema

NameRequiredDescriptionDefault
segmentsYesArray of line segments (max 1000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it discloses very little beyond the output type. It says nothing about algorithmic cost (naive pairwise is O(n^2)), how collinear/overlapping or endpoint-touching segments are treated, ordering of results, or the 1000-segment cap (which lives only in the schema). Major behavioral gaps for a geometry routine with many degenerate cases.

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?

A single sentence with no filler, front-loading the operation and ending with the return type. Every clause earns its place.

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?

With no annotations and no output schema, the description should spell out the return shape, but 'returning intersection points' is ambiguous for a pairwise operation (one point per intersecting pair? flat list? coordinates tied to segment indices?). It is callable as written but under-specified for an agent that must consume the result.

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?

There is a single parameter with 100% schema description coverage, so the schema already documents the segments array and the max-1000 constraint. The description only restates that inputs are 2D line segments, adding no format, ordering, or structural meaning beyond the schema. Baseline 3 is correct.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource+scope: 'Find all pairwise intersections among a set of 2D line segments, returning intersection points.' An agent can immediately tell this is a geometry operation distinct from siblings like convex_hull or bezier_clip. It does not, however, explicitly contrast itself with any named sibling, which the highest score would require.

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?

Usage is implied rather than stated: the tool clearly applies when an agent has a collection of 2D segments and needs their crossings, but there is no explicit when-to-use, when-not-to-use, or reference to an alternative tool. For a self-contained math utility this is adequate but leaves the routing entirely to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools