get_selection
Detect whether a selection exists before editing and return its bounds, pixel area, and selected-region map to prevent unintended changes.
Instructions
Describe the current selection: whether there is one, and what it covers.
Returns `bounds`, the pixel `area` actually inside the selection, and a `map` of
the selected region using `#` for selected and `.` for not, in the same shape
`get_pixels(format="map")` uses. The map is capped, and omitted for a selection
larger than the cap, since a wall of characters is not feedback.
Worth calling before a large edit: a selection you forgot about is the difference
between changing what you meant and changing a corner of it.
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": {
"filename": "<filename>"
},
"name": "get_selection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes |