find_text
Locate a known text fragment on a PDF sheet and return its image-pixel coordinates, optionally within a region and capped by a hit limit.
Instructions
LOCATE a known string on a sheet — the complement to read_sheet_text (which returns what a region SAYS; this finds WHERE a string you already know sits). Case-insensitive substring match against each pdf.js text run, so a room label split across runs ("OFFICE" then "134" as separate items) needs a find_text call per fragment, or read_sheet_text over a region to see the whole thing joined. Every hit tells you which room a polygon belongs to — the locate-then-trace workflow: find_text the room number, then measure_polygon (One-Click is temporarily gated on this server) on that room's wall faces. Optionally restrict to a region {x0, y0, x1, y1}; results cap at limit (default 200), with count/truncated telling you exactly how much a tighter region or higher limit would recover. Coordinates are image px at render scale 2.0: PDF pt × 2, origin top-left, y down (the browser canvas's native space). Sheet payloads carry dims in both px and pt.
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": {
"sheet": "<sheet>",
"q": "<q>"
},
"name": "find_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Text to find — a room number ('134'), a label fragment ('RECEPTION'), a schedule tag ('CPT-1') | |
| limit | No | Max hits returned | |
| sheet | Yes | ||
| region | No | Rect in image px (origin top-left, y down); omit for the full sheet |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | ||
| hits | Yes | ||
| count | Yes | Total matches before the limit cap | |
| sheet | Yes | ||
| truncated | Yes | true = count exceeds hits.length; narrow the region or raise limit |