Skip to main content
Glama

pir-mcp

A motion sensor for AI agents.

"Gives your LLM agents enough info to be a helpful "watcher" without being a privacy nightmare like Windows Recall" -Solteris-Dev

A PIR sensor tells you that something moved, never what. This is the same idea for a screen: an MCP server that watches named rectangles and answers "did this change?" and "has this gone still?" with a number, a size and a timestamp. No tool in it returns pixels, image files, or anything that could be turned back into a picture.

It exists because an agent driving a desktop keeps needing the same two things: wake me when the build output moves and tell me if this status bar has stopped ticking. Both are motion questions. Neither needs a screenshot.

What it does

  • pir_pick_region ask the person at the screen to draw the rectangle, the way a regional screenshot works (slurp, slop). The human chooses what is sensed; the agent gets the geometry. Use this whenever someone is there.

  • pir_pick_mask the same gesture for a patch inside a region to ignore (a clock, a spinner, a caret).

  • pir_define_region the scriptable path: name a rectangle by global layout coordinates, with optional masks.

  • pir_pick_window / pir_define_window watch a window instead of a fixed rectangle. Its geometry is looked up again before every capture, so the region follows the window when it moves; a resize counts as maximal change. The pick offers your visible windows as boxes to click.

  • pir_sample capture once, score against the previous sample of that region. Cheap; also the way to check the capture command works.

  • pir_wait_for_change block until the region departs from how it looked when the call began, or time out. A doorbell.

  • pir_wait_for_stillness block until nothing has changed for still_for_ms, or time out. A short window means "the animation settled, safe to act". A long window on something that should keep changing means it is frozen, and still=true is the alarm.

  • pir_list_regions, pir_remove_region housekeeping.

Every comparison reports two numbers over a coarse grid of averaged colour cells (at most 64 across, each at least 4 px), both 0 for identical and 1 for black against white:

  • rmse over the whole grid: did the region as a whole move? A cursor edge or an antialiased caret scores about 0.02; a dialog opening 0.1 or more. This is the default metric, threshold 0.05.

  • peak the single most-changed cell: did anything in it move? A clock digit flipping inside a 1920-wide status bar scores rmse 0.018 (invisible to the default) but peak 0.145. Use metric=peak for a small thing that should tick inside a larger region.

Averaging is what makes this a sensor rather than a camera: 64 cells cannot be read.

Related MCP server: markupR MCP Server

What it deliberately does not do

  • It never returns image data. There is no snapshot tool and none is planned. If an agent needs to see, use the screenshot tool your environment already has, so that choice stays explicit and yours.

  • It never writes frames to disk. A capture lives in memory for the milliseconds it takes to reduce it to a grid, and only the grid of the last sample is kept per region.

  • It does not capture on its own. Every sample is a tool call the agent made, visible in the transcript, and pir_pick_region carries a purpose line the agent has to write down before you draw.

What it does reveal, so you can decide whether that is acceptable: that a given rectangle changed, at a given time, by a given magnitude. On a region covering a chat window that is presence information. Choose regions accordingly; the server has no opinion.

The capture itself is delegated to a command you configure, run with your privileges. The default is grim, so nothing here has screen access that you did not already give to grim.

Install

It is on npm as pir-mcp and in the official MCP Registry as io.github.Solteris-Dev/pir-mcp, so most clients can run it with npx -y pir-mcp and no clone:

claude mcp add -s user pir -- npx -y pir-mcp

From source:

git clone https://github.com/Solteris-Dev/pir-mcp
cd pir-mcp && npm install && npm run build

Requires Node 20+ and a screenshot tool that can write binary PPM to stdout.

Capture command

PIR_CAPTURE_CMD is a template; {x} {y} {w} {h} are substituted and the result runs under sh -c. It must print a binary PPM (P6) to stdout.

environment

command

wlroots / Hyprland / Sway (default)

grim -g "{x},{y} {w}x{h}" -t ppm -

X11 with maim

maim -g {w}x{h}+{x}+{y} -f png | magick png:- ppm:-

X11 with ImageMagick

import -window root -crop {w}x{h}+{x}+{y} +repage ppm:-

macOS

screencapture -x -R{x},{y},{w},{h} -t png /dev/stdout | magick png:- ppm:-

Coordinates are whatever the capture tool uses. On a wlroots layout that is the global layout, so an output placed left of the primary has negative x.

Selector command

PIR_SELECT_CMD runs when an agent calls pir_pick_region or pir_pick_mask and must print x,y wxh. Set it to an empty string to remove those tools entirely.

environment

command

wlroots / Hyprland / Sway (default)

slurp -f "%x,%y %wx%h"

X11

slop -f "%x,%y %wx%h"

macOS

see contrib/macos (untested)

Window commands

PIR_WINDOW_GEOMETRY_CMD gets {id} substituted and must print x,y wxh for that window; PIR_PICK_WINDOW_CMD must print the id of the window the person chose. Both default to Hyprland (via jq and slurp -r). Set either to an empty string to remove the corresponding tools. Window ids are limited to [A-Za-z0-9_.:-] before they reach a shell.

environment

geometry

pick

Hyprland (default)

hyprctl -j clients | jq -r --arg id "{id}" '.[] | select(.address==$id) | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"'

visible windows as slurp boxes, prints the address

Sway

swaymsg -t get_tree | jq -r '.. | select(.id? == {id}) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"'

swaymsg -t get_tree | jq -r '.. | select(.visible? == true) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height) \(.id)"' | slurp -r -f '%l'

X11

xdotool getwindowgeometry --shell {id} | awk -F= '/^X/{x=$2}/^Y/{y=$2}/^WIDTH/{w=$2}/^HEIGHT/{h=$2}END{print x","y" "w"x"h}'

xdotool selectwindow

Only the Hyprland pair has been run; the others are written from the tools' documentation.

Claude Code

claude mcp add -s user pir -- npx -y pir-mcp
# or, from a source checkout:
claude mcp add -s user pir -- node /path/to/pir-mcp/dist/stdio.js

Blocking calls default to 55 s and are capped by PIR_MAX_WAIT_MS (540 s). Keep the cap under your host's MCP tool timeout; an agent that needs to watch for longer just calls again.

Other settings

variable

default

meaning

PIR_REGIONS

unset

JSON file of regions to define at startup

PIR_THRESHOLD

0.05

default change threshold

PIR_INTERVAL_MS

500

default sampling period

PIR_DEFAULT_WAIT_MS

55000

default timeout for blocking calls

PIR_MAX_WAIT_MS

540000

cap for blocking calls

PIR_CAPTURE_TIMEOUT_MS

10000

how long one capture may take

PIR_SELECT_TIMEOUT_MS

60000

how long the person has to draw a selection

PIR_MAX_CELLS

64

grid resolution on the long side; smaller is coarser and more private

A regions file looks like:

[
  { "name": "bar", "x": 0, "y": 0, "w": 1920, "h": 26,
    "masks": [{ "x": 1690, "y": 0, "w": 110, "h": 26 }] }
]

Example

The case that produced this: a status bar that occasionally froze for hours while its process looked healthy. The clock in it should change every minute, so a bar that is still for three minutes is a frozen bar.

pir_pick_region         name=bar purpose="watch the status bar for a freeze"
pir_wait_for_stillness  name=bar still_for_ms=180000 metric=peak timeout_ms=540000

still=true comes back only if the bar stopped; otherwise the call returns still=false at the timeout and the agent calls again. Nothing on the screen was ever seen, and the person drew the rectangle themselves.

Contributing starting points

contrib/macos/ holds an AppKit rectangle selector and capture recipe, written blind and untested. If you run it on a real Mac, fix what breaks and send it back.

Tests

npm test

License

MIT.

Available Tools

10 tools
pir_define_regionA

Name a rectangle of the screen to watch. Coordinates are in the global layout the capture tool uses (on a multi-monitor wlroots layout an output left of the primary has negative x). Masks are rects inside the region, in region-local pixels, that are ignored: put a clock or spinner there. Redefining a name replaces it and forgets its last sample.

ParametersJSON Schema
NameRequiredDescriptionDefault
hYesheight, pixels
wYeswidth, pixels
xYesleft edge, pixels
yYestop edge, pixels
nameYes
masksNo

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description must carry the full burden of behavioral disclosure. It does so effectively: it details the global coordinate system and negative x on multi-monitor layouts, explains that masks are ignored regions-local rects, and discloses that redefining a name replaces the old region and discards its last sample—a significant side effect. It does not mention return values or errors, but for a definition tool the described behaviors are quite transparent.

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?

The description is three short sentences with no filler. The main purpose is front-loaded in the first sentence, followed by essential coordinate clarification and mask/redefinition behavior. Every sentence delivers necessary information that a caller would need, and the structure is easy to scan.

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?

The tool has 6 parameters, no output schema, and no annotations, so the description carries significant weight. It explains the coordinate system, masks, and redefinition side effects, but it omits any mention of what the tool returns (e.g., success/failure, region handle) or any error conditions. Given the absence of an output schema, this leaves a gap in fully understanding the call contract. The description covers usage well but falls short of being completely context-rich.

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?

The input schema has only terse descriptions for x/y/w/h ('left edge, pixels'), and no descriptions for name or masks. The tool description compensates by explaining the coordinate frame (global layout, negative x on wlroots multi-monitor) and that masks are area-local and ignored—meaning that the description adds crucial semantic value for coordinate interpretation and mask usage that the schema lacks. Given the 67% schema coverage, the description lifts the parameters to a functional understanding.

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 description opens with 'Name a rectangle of the screen to watch', a precise verb-noun-resource statement that immediately distinguishes this tool from siblings like pir_define_window and pir_pick_region. It clearly identifies the action (defining a region) and the object (a named rectangle to monitor). The mention of masks and redefinition further clarifies its role without any ambiguity.

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?

The description conveys exactly what the tool does and provides useful context about when to use it (for defining a rectangle to watch) and how masks work. It does not explicitly point to alternative tools or state when not to use it, but the presence of pir_define_window and pir_pick_region in the sibling list makes the intended usage clear. Since there are no exclusions or alternatives mentioned, it falls between implied usage and clear context with no exclusions, earning a 4.

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

pir_define_windowA

Watch a window rather than a fixed rectangle: geometry is looked up from the window id before every capture, so the region follows the window when it moves. A resize counts as maximal change. Masks are window-local. The id is whatever your window-geometry command understands (a Hyprland address like 0x5f3a..., an X11 window id).

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
masksNo
windowYes

TDQS

A4.4/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It reveals several important behaviors beyond the schema: window geometry is re-looked-up per capture, resizes count as maximal change, masks are window-local, and the accepted id formats are described. This is substantial and genuinely helpful.

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?

Three sentences with no filler. The core behavioral distinction is front-loaded, and the id-format detail is placed at the end as useful supplementary information. Every sentence earns its place.

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?

Given no annotations and no output schema, the description does a good job covering the key behavior and the window-id formats. Minor gaps remain: the `name` parameter is not defined, and mask coordinate semantics could be more explicit. These are inferable but not fully spelled out.

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?

Schema description coverage is 0%, so the description must compensate. It does explain the meaning of `window` well and adds that masks are window-local. However, the required `name` parameter is left unexplained, and the exact coordinate system of the masks (origin relative to window) is only implied by 'window-local'. Partial compensation, not complete.

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 description begins with a specific verb and resource: 'Watch a window rather than a fixed rectangle.' It clearly states that geometry is looked up from the window id before every capture, and it explicitly contrasts this with fixed rectangles, distinguishing it from the sibling pir_define_region.

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?

The description gives clear context for when to use the tool: when the region should follow a moving window rather than stay fixed. It also explains what window identifiers are accepted. It does not explicitly name sibling alternatives or state when not to use it, but the contrast with 'fixed rectangle' implies the boundary adequately.

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

pir_list_regionsA

The regions currently defined, with their geometry and masks.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the behavioral disclosure burden. It communicates what data is included (geometry and masks) and implies a non-mutating list operation, but it does not state side-effect-free behavior, return format, or whether the list is live/snapshot. This is adequate but not rich, matching the 'minimal viable' level.

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?

The description is a single concise sentence with no filler. It front-loads the core subject ('regions currently defined') and appends the relevant detail about geometry and masks with no wasted words.

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 simple zero-parameter listing tool, the description is nearly complete: it states the resource and the included contents. It does not specify the exact return structure or mask representation, but the absence of params and output schema keeps the complexity low enough that this is only a minor gap.

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?

The tool has zero parameters, so the input schema is inherently complete and there is little for the description to add. The baseline of 4 applies because no parameter documentation burden exists.

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 clearly identifies the resource (currently defined regions) and the information returned (geometry and masks), making the tool's purpose understandable. The tool name supplies the 'list' verb, and the resource differentiates it from sibling actions like define_region, remove_region, and pick_region. It stops short of a 5 because the description itself is a noun phrase rather than an explicit action statement.

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?

No explicit when-to-use or when-not-to-use guidance is provided, nor are alternatives mentioned. However, the read-only listing nature is implied by 'currently defined,' which makes it reasonable for an agent to use this when it needs an overview of existing regions. This qualifies as implied usage rather than fully absent guidance.

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

pir_pick_maskA

Ask the person to draw a rectangle inside an existing region that should be ignored (a clock, a spinner, a caret). Forgets the region's last sample, since masked grids are not comparable to unmasked ones.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses two important behavioral traits: the operation is interactive ('Ask the person') and it invalidates the region's last sample, explaining why masked grids are not comparable. This is meaningful side-effect disclosure, though it does not mention irreversibility or whether an existing mask is replaced.

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?

Two concise sentences with no filler. The primary action is front-loaded, the use-case examples are compact, and the side effect is explained in a single, purposeful second sentence. Every part adds value.

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?

For a single-parameter tool, the description covers the action, the interactive nature, the target scenario, and a key side effect. However, it lacks explicit parameter-to-region mapping and does not describe what happens after drawing or what the tool returns, leaving some operational ambiguity.

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

Parameters2/5

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

The schema has one required string parameter, `name`, with no description coverage. The description says 'inside an existing region' but never states that `name` must identify that region, nor does it clarify what value to pass. The parameter semantics are therefore left mostly to inference.

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 clearly communicates an action: ask the person to draw a rectangle inside an existing region so that part is ignored. The examples (clock, spinner, caret) and the mention of 'masked grids' make the mask-specific purpose clear and distinguish it from the sibling sampling/region tools.

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?

The description implies the tool should be used when an existing region contains a distracting element, and it explicitly requires the region to already exist. However, it does not name alternatives or state when not to use this tool, so the guidance is mostly implicit.

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

pir_pick_regionA

Ask the person at the screen to draw the rectangle to watch (a selector such as slurp appears; Escape cancels). Prefer this over pir_define_region whenever a human is present: they choose what is sensed, and you get the geometry back. Blocks until they finish or the selector times out.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
purposeNoone line on why you want to watch it; returned unchanged so it lands in the transcript

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool blocks until completion or timeout, can be cancelled with Escape, and returns the geometry. It doesn't mention whether the picked region is stored for later use, but the core interactive and blocking traits are clear.

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?

Three sentences, no filler, with the core behavior front-loaded and the usage guidance and blocking behavior included. Every sentence 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?

The description is largely sufficient for knowing what the tool does and how it behaves, but it omits what 'name' is for, which is a required parameter. Without annotations or an output schema, that gap keeps the definition at minimum viable rather than fully complete.

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

Parameters2/5

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

Schema coverage is only 50%: the required 'name' parameter has no schema description and the tool description does not clarify it. The optional 'purpose' is documented in the schema, but the description adds no meaning for the parameters, so it fails to compensate for the uncovered one.

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 description clearly states a specific action: ask the person at the screen to draw a rectangle to watch. It distinguishes itself from pir_define_region by explaining the human-in-the-loop interaction and explicitly calling out that alternative.

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

Usage Guidelines5/5

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

The description gives an explicit usage rule: prefer this over pir_define_region whenever a human is present. It also explains the UX outcome and blocking behavior, so an agent knows when this tool is the right choice.

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

pir_pick_windowA

Ask the person at the screen to click the window to watch (visible windows are offered as boxes; Escape cancels). The region then follows that window. Prefer this over pir_define_window when a human is present.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
purposeNoone line on why you want to watch it; returned unchanged so it lands in the transcript

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It discloses the interactive prompt, the box overlay, Escape cancellation, and the follow behavior. It stops short of stating whether an existing region of the same name is overwritten or what the cancellation return looks like, but the core interaction is transparent.

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?

Two sentences, front-loaded with the core user interaction, with no wasted or redundant wording. It adds essential behavioral detail without restating the tool name or schema.

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 human-in-the-loop picker, the description covers what the user sees, how to cancel, what happens after selection, and when to prefer it over the main sibling. It is slightly incomplete only in not describing return/cancel semantics or the required name parameter's role.

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?

Schema coverage is only 50% because the required 'name' property lacks a description. The tool description adds operational context but does not explicitly explain how 'name' maps to the region that follows the window, leaving that inference to the agent. The 'purpose' parameter is already handled by the schema description.

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 description names a specific action ('Ask the person at the screen to click the window to watch'), the interaction mode (visible windows offered as boxes), and the outcome (the region follows that window). This clearly identifies the tool as a human-driven window picker and distinguishes it from region- or mask-based siblings.

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

Usage Guidelines5/5

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

It explicitly states 'Prefer this over pir_define_window when a human is present,' giving a concrete routing condition and naming the alternative. This is sufficient for an agent to select this tool over the most similar sibling without opening another schema.

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

pir_remove_regionC

Forget a region.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes

TDQS

C2.6/5.0
Behavior2/5

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

No annotations are present, so the description carries the full burden. It only says 'Forget a region,' implying deletion, but discloses nothing about whether the action is irreversible, whether it cascades to dependent entities (e.g., windows or masks that reference the region), whether it errors on nonexistent names, or any side effects. This is a significant gap for a mutation operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence, which is concise, but it is overly minimal. It front-loads the core action but lacks necessary elaboration. The brevity is not harmful, but it fails to provide sufficient detail for correct usage.

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

Completeness2/5

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

Given the simplicity (one param, no output schema), the description could be sufficient if it addressed key behaviors. However, it omits crucial context such as error handling, irreversibility, and effects on related resources. The sibling tools suggest regions are used in workflows (e.g., picking, defining), so removal likely has implications that are not disclosed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It does not explain the 'name' parameter beyond implying it identifies a region. While the parameter name is self-explanatory, there is no information about format, case sensitivity, or whether it must match an existing defined region exactly. The description adds no value beyond the schema itself.

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 states a clear verb ('Forget') and resource ('region'), indicating removal. It differentiates from sibling tools like define_region (creation) and list_regions (retrieval) at a basic level. However, it does not elaborate on what 'region' specifically refers to in context, but the tool name and siblings make it reasonably clear.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It does not mention prerequisites (e.g., region must exist), nor does it contrast with siblings like pir_define_region or pir_pick_region. The usage context is implied by the name but not explicitly stated.

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

pir_sampleA

Capture the region once and score it against the previous sample of the same region (null on the first call). Cheap and non-blocking: use it to check the capture command works, to take a baseline before doing something, or to ask 'did anything happen there since I last looked?'.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes

TDQS

A3.5/5.0
Behavior3/5

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

The description discloses important behavior: null on first call, cheap, and non-blocking. With no annotations provided, the description carries the behavioral burden. It does not mention that each call updates the stored baseline sample (a side effect), nor does it describe the return value/score format. This is useful but incomplete.

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?

Two sentences with zero filler. The core function is front-loaded, followed by practical use cases. Every clause earns its place.

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

Completeness2/5

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

The core function and use cases are clear, but significant gaps remain: the 'name' parameter is undocumented, the meaning of 'score' is vague, there is no output schema, and the side effect of updating the baseline is omitted. An agent cannot fully determine how to call this correctly or interpret the result.

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

Parameters1/5

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

Schema description coverage is 0%, and the sole parameter 'name' is never explained in the description. There is no statement that 'name' identifies a previously defined region, nor any format guidance. The description refers to 'the region' but never links it to the input parameter, leaving the agent to guess its meaning.

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 description states a specific verb and resource: 'Capture the region once and score it against the previous sample of the same region.' It also clarifies the first-call behavior (null) and distinguishes itself from blocking siblings by emphasizing it is 'non-blocking.' An agent can understand exactly what this tool does and how it differs from waiting or defining operations.

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?

Three concrete use cases are spelled out: check the capture command works, take a baseline, and ask 'did anything happen there since I last looked?'. These give clear context for when to invoke this tool. However, it does not explicitly name alternative tools or state when not to use it beyond implying that blocking waits are different.

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

pir_wait_for_changeA

Block until the region looks different from how it looked when this call started, or until timeout_ms. Returns changed=true with the score, or changed=false with the largest score seen. Use it as a doorbell: 'wake me when the build output moves', 'when the dialog closes', 'when the game loads'.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
metricNowhat the threshold applies to. rmse (default): the whole region moved. peak: any single cell moved, for a small thing that should tick inside a larger region (a clock in a bar).
thresholdNoscore that counts as a change, 0..1 (default 0.05). With metric=rmse a caret or cursor edge scores about 0.02 and a dialog opening 0.1+. With metric=peak a digit flipping in one cell scores about 0.05-0.2.
timeout_msNogive up after this long (default 55000, max 540000)
interval_msNosampling period (default 500)

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does so well: it discloses blocking semantics, timeout behavior, and both return outcomes. It does not discuss side effects or prerequisites like having the region already defined, but as a read/observe tool those are less critical.

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?

Two sentences plus examples carry the core definition, return behavior, and use cases with no fluff. The mechanism is front-loaded and the examples are concrete rather than filler.

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 blocking wait tool with no output schema and no annotations, the description covers the essential return values, timeout, and representative use cases. It could be more complete by stating that the region must already exist or be defined, but the core agent-facing contract is adequately specified.

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?

Schema coverage is high (80%), so the baseline is 3; the description adds little parameter-level detail beyond what the schema already provides. The one uncovered parameter, name, is not described in either place, and the description doesn't help resolve the schema's contradictory timeout max (540000 in text vs 9007199254740991 in maximum).

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 description states a precise behavior: block until the region changes from its starting state or until timeout_ms. It also defines the return contract (changed=true with score, changed=false with largest score), which makes the tool's purpose unmistakable and differentiable from wait_for_stillness.

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?

The 'doorbell' framing plus concrete examples (build output moves, dialog closes, game loads) gives the agent clear when-to-use guidance. It doesn't explicitly mention when not to use it or name wait_for_stillness as the inverse alternative, so it stops short of a 5.

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

pir_wait_for_stillnessA

Block until consecutive samples have stayed below threshold for still_for_ms, or until timeout_ms. A short window means 'the page/animation has settled, safe to act'. A long window on something that should keep changing (a clock, a progress bar, a status bar) means it is frozen: still=true is then the alarm.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
metricNowhat the threshold applies to. rmse (default): the whole region moved. peak: any single cell moved, for a small thing that should tick inside a larger region (a clock in a bar).
thresholdNoscore that counts as a change, 0..1 (default 0.05). With metric=rmse a caret or cursor edge scores about 0.02 and a dialog opening 0.1+. With metric=peak a digit flipping in one cell scores about 0.05-0.2.
timeout_msNogive up after this long (default 55000, max 540000)
interval_msNosampling period (default 500)
still_for_msYeshow long nothing may change

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure, and it does so well: it explains blocking, the condition for success, timeout behavior, and the 'still=true' alarm state. It does not describe the full return shape or whether the operation is read-only, but the core behavior is transparent.

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?

The description is two tight sentences with no filler. The primary behavior is front-loaded, and the second sentence adds valuable interpretive guidance about short versus long windows.

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?

The core semantics are covered, but with no output schema and six parameters, the description leaves gaps: the meaning of 'name' is unclear, and the exact return value on timeout versus success is only hinted at through 'still=true'. It is adequate but not fully complete.

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?

The input schema covers 5 of 6 parameters with descriptions, so the baseline is 3. The tool description adds little parameter-specific meaning beyond referencing threshold and still_for_ms; notably, the required 'name' parameter is left undocumented in both the schema and description.

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 states a specific behavior: block until consecutive samples stay below threshold for still_for_ms or timeout_ms. It clearly identifies the tool as a stillness/change-frozen detector, though it does not explicitly contrast itself with the sibling pir_wait_for_change.

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?

The description gives practical guidance: a short window means the page has settled and is safe to act, while a long window on something that should keep changing indicates frozen content. It does not explicitly mention alternatives or provide exclusions, but the intended use cases are clear.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 10 tool updatesv0.1.0
    • First observedpir_define_region
    • First observedpir_define_window
    • First observedpir_list_regions
    • First observedpir_pick_mask
    • First observedpir_pick_region
    • First observedpir_pick_window
    • First observedpir_remove_region
    • First observedpir_sample
    • First observedpir_wait_for_change
    • First observedpir_wait_for_stillness

TDQS

A3.8/5.0

Scored across 10 tools

Disambiguation5/5

Each tool targets a distinct operation: sampling, defining, picking, waiting, listing, removing. The define/pick and change/stillness pairs are clearly differentiated by coordinate vs. human selection and blocking vs. non-blocking behavior.

Naming Consistency5/5

All tools follow the pir_ prefix with snake_case verb_noun or verb_prep_noun patterns (e.g., define_region, wait_for_change, list_regions). The naming is uniform and predictable.

Tool Count5/5

Ten tools is well-scoped for a screen-region monitoring server, covering definition, selection, observation, and removal without unnecessary duplication or bloat.

Completeness4/5

The lifecycle is well covered: define/pick/list/remove regions, plus sample and wait operations. Minor gaps exist—masks can only be added interactively via pir_pick_mask, and there is no explicit update tool—but redefining a region replaces it, so most workflows are supported.

Related MCP Connectors

Related MCP Servers