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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "assetId": "<assetId>",
      "clipId": "<clipId>",
      "at": "<at>",
      "kinds": "<kinds>",
      "roi": "<roi>",
      "maxResults": "<maxResults>",
      "minStrength": "<minStrength>",
      "focal": "<focal>",
      "edgeOf": "<edgeOf>",
      "space": "<space>",
      "detail": "<detail>",
      "overlay": "<overlay>",
      "projectId": "<projectId>"
    },
    "name": "detect_geometry"
  }
}

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.
overlayYestrue: the answer also has a picture of the part of the frame searched (the roi and a margin, or the whole frame) with the results drawn and numbered as listed: quads Q1, corners C1, lines L1, vanishing points V1. Use it to check what was found. Take coordinates from the numbers, not off the picture: it has no previewId. 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 / overlay / description
      Previous value: -"Draw the results over the frame. Not drawn yet: true answers a note. null: false."New value: +"true: the answer also has a picture of the part of the frame searched (the roi and a margin, or the whole frame) with the results drawn and numbered as listed: quads Q1, corners C1, lines L1, vanishing points V1. Use it to check what was found. Take coordinates from the numbers, not off the picture: it has no previewId. null: false."
  2. 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."
  3. 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"
      +]
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations by disclosing cost and latency ('Free; one frame takes under a second'), the response shape (prose first, one json block after), output coordinate spaces, and a real limitation ('text and depth need models that are not deployed yet and return a note'). The deterministic, sub-pixel claim tells the agent it can trust the numbers rather than treating them as heuristic guesses.

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?

Purpose and the when-to-use rule are front-loaded, and the edge/border detail about quads and snapping is placed where it matters. The inline example enumerating every null-able parameter (clipId:null, focal:null, edgeOf:null, space:null...) is padding an agent does not need, which costs a point.

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

Completeness5/5

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

For a 13-parameter, deeply nested tool with no output schema, the description still covers what comes back (source pixels plus film and film_norm), how results are ordered, the overlay as a verification aid, and which kinds are non-functional. That is enough for an agent to call it correctly without opening the schema.

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, but the description adds practical meaning on top: a full worked call showing how the required params are typically filled, the roi rule that a box drawn on a preview needs its previewId, and a warning that overlay coordinates must be read from the numbers, not the picture. These are usage constraints the schema's field-level text does not state as workflow guidance.

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?

States a specific verb and an enumerated set of resources (edges, lines, corners, quads, vanishing points, trackability) applied to exactly one frame of an asset, clip or composed film. An agent can tell this apart from scene/moment detection siblings because the description emphasizes deterministic geometric measurement of a single frame rather than content analysis over time.

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?

Gives explicit conditions: use it before a pin or surface track to get exact corners, or to test whether a region has enough texture to track, with the concrete note that a blank white sign reads as edges. It stops short of naming the specific sibling tool to call next (e.g. propose_surfaces), so the routing is contextual rather than named.

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.