Skip to main content
Glama

Find edges, lines, corners and surfaces in a frame

detect_geometry
Read-onlyIdempotent

Find edges, straight lines, corners, quads (a sign, a screen, a poster), vanishing points and how trackable a region is, on one frame of an asset, a clip or the composed film. Deterministic image measurement, not a guess: corners are refined below a pixel, quads are scored on the edges under their sides and come with their true width over height when it can be read. Use it before a pin or a surface track to get exact corners, or to check whether a region has enough texture to track (trackability says edges, features or hybrid: a blank white sign is edges). Example: detect_geometry({assetId:"vid_street", clipId:null, at:{seconds:3, atSpace:"source"}, kinds:["quads"], roi:[], maxResults:5, minStrength:null, focal:null, edgeOf:null, space:null, detail:null, overlay:null}). Results come in source pixels and in film and film_norm when a clip shows the asset then, prose first and one json block after. Free; one frame takes under a second.

Input Schema

NameRequiredDescriptionDefault
atYesWhen to read the frame.
roiYes[] reads the whole frame. One box, quad or polygon (any space, e.g. a box you drew on a preview with its previewId) reads only there. With trackability, a quad or box roi is scored as the region to track.
focalYesThe camera's focal length in source pixels when you know it (a quad's true aspect is then exact). null estimates it.
kindsYesWhat to find: edges (polylines), lines (straight segments), corners (refined below a pixel, each L, T or X with its edge directions), quads (four-sided surfaces like a sign or a screen, with edge support, an even inside and the true aspect), vanishing (vanishing points, horizon, focal length), trackability (a heatmap, and with a quad or box roi which tracker to use). text and depth need models that are not deployed yet and return a note.
spaceYesThe space of each result's points. null: source for an asset or clip, film for the composed film. Every result also carries source (when there is one), film and film_norm. Spaces: source, source_norm, clip, film, film_tl, film_norm, preview, preview_norm, surface, tile.
clipIdYesA clip: reads its asset at the source second it shows, and maps the results to the film through the clip's transforms. Else null.
detailYesHow much the answer says: brief is one line per result with its ids; normal (null) adds the transform; full adds every matrix of the chain.
edgeOfYesFor quads, which edge of a bordered surface the sides sit on: outer, inner or auto (null): of the two, the one with clearly more support along the sides, the same kind on every side, else the outer edge. The same rule as snap, so snapping a detected quad does not move it.
assetIdYesThe video or image to read, at its own pixels (source space). null with clipId reads the clip's asset; null with both reads the composed film.
overlayYesDraw the results over the frame. Not drawn yet: true answers a note. null: false.
projectIdYesThe project this call runs on without changing the open project. null (or leaving it out) uses the open project. wait_for_jobs takes the projectId of the calls that started the jobs.
maxResultsYesResults per kind, 1 to 50. null: 10.
minStrengthYes0 to 1: drop weaker results. null: 0.1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / edgeOf / description
      Previous value: -"For quads, which edge of a bordered surface the sides sit on: outer, inner or auto (null): the outer edge when a border shows on all four sides, else the edge each side was found on. The same rule as snap, so snapping a detected quad does not move it."New value: +"For quads, which edge of a bordered surface the sides sit on: outer, inner or auto (null): of the two, the one with clearly more support along the sides, the same kind on every side, else the outer edge. The same rule as snap, so snapping a detected quad does not move it."
  2. Changed2 schema fields changed
    • addedInput schema / properties / edgeOf
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "outer",
      +        "inner",
      +        "auto"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "For quads, which edge of a bordered surface the sides sit on: outer, inner or auto (null): the outer edge when a border shows on all four sides, else the edge each side was found on. The same rule as snap, so snapping a detected quad does not move it."
      +}
    • changedInput schema / required
      Previous value: -[
      -  "assetId",
      -  "clipId",
      -  "at",
      -  "kinds",
      -  "roi",
      -  "maxResults",
      -  "minStrength",
      -  "focal",
      -  "space",
      -  "detail",
      -  "overlay",
      -  "projectId"
      -]New value: +[
      +  "assetId",
      +  "clipId",
      +  "at",
      +  "kinds",
      +  "roi",
      +  "maxResults",
      +  "minStrength",
      +  "focal",
      +  "edgeOf",
      +  "space",
      +  "detail",
      +  "overlay",
      +  "projectId"
      +]
  3. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds substantial extra context: determinism ('not a guess'), sub-pixel corner refinement, quad quality scoring, output shape (prose first, one json block after), coordinate spaces returned, cost ('Free') and latency ('under a second'). It even flags a not-yet-implemented capability (overlay returns a note).

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 purpose sentence is front-loaded and every later clause carries real information about precision, output or performance. The 13-argument example call is bulky and slightly crowds the prose, shaving a point off an otherwise efficient structure.

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

Completeness4/5

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

For a 13-parameter tool with nested objects and no output schema, the description covers enough: it explains the return format, the result spaces, cost and speed, and the availability caveats for text/depth and overlay. Deeper ROI/space composition semantics are left entirely to the schema, which is rich but densely nested.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds meaning by showing a full example call that makes the null-default conventions concrete and by explaining semantic defaults (null time reads a preview's own second, quads carry true aspect when focal is known). It does not individually annotate the more obscure parameters (roi, edgeOf) beyond the schema, keeping it below a 5.

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 opening names a specific verb and an enumerated set of resources (edges, straight lines, corners, quads, vanishing points, trackability) scoped to 'one frame of an asset, a clip or the composed film'. The subtitle and body make the boundary against siblings like snap, pin_moment, track_plane and find_objects easy to infer.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly routes usage: 'Use it before a pin or a surface track to get exact corners, or to check whether a region has enough texture to track', and explains when trackability is the right kind (blank white sign → edges). It also warns that text/depth kinds return a note rather than results. Lacks a direct comparison to other detection-family siblings such as find_objects or track_detection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.