Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:A9T9 RPA Result Inspection

From Leeroopedia
Knowledge Sources
Domains AI_Agent, MCP
Last Updated 2026-10-22 00:00 GMT

Overview

Mechanism for an AI agent to inspect the results of a macro execution by capturing screenshots, retrieving logs, and extracting the page structure for the next iteration.

Description

Result Inspection is the feedback loop that gives the AI agent (or MCP client) information about what happened after a macro run. After `run_macro` executes, the agent needs to see:

  • Screenshot: what the page looks like now (`get_screenshot`)
  • Logs: the execution log text, including any errors and the failing line (`get_logs`)
  • Page structure: the page as an accessibility tree with `ref=N` locators (`browser_snapshot` with mode `tree`), or as a fields/clickables list (mode `fields`)

This inspection enables the AI agent's iteration loop: the agent runs a macro, inspects the results, identifies failures or missing steps, modifies the macro via `set_macro`, and runs again. The `look` parameter on `run_macro` allows combining execution and inspection in a single call (returning a delta tree, full tree, screenshot, or both).

Usage

Use this principle when an AI automation agent needs to observe the outcome of its actions to decide the next step — the core of an agentic automation loop.

Theoretical Basis

Failed to parse (syntax error): {\displaystyle \text{Inspect}(\text{after\_run}) = \text{Screenshot} \oplus \text{Logs} \oplus \text{PageTree} }

The agent loop:

repeat:run→inspect→decide→modify

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment