FrameParse

v0.2.0
io.github.RajKavadia/frameparse Checked 3 days ago Published 6 days ago

4-layer webpage frames + MCP observe/act for agents.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

frame_open

Parse a webpage (URL, raw HTML, live browser DOM snapshot from frameparse://browser-extractor.js, or built-in fixture) deterministically with zero AI, cache it in a session, and return ONLY Frame 1 (Structure: every s# landmark listed) + token compression telemetry. Always call this first; use frame_read layers 2–4 with regions[] to scope text/controls/actions.

ParameterTypeDescription
fixturestringOptional built-in sample webpage fixture for testing.
htmlstringRaw HTML string to parse directly.
includeHiddenbooleanInclude hidden/aria-hidden elements (default: false).
sessionIdstringOptional custom session ID to reuse or overwrite.
snapshotobjectLive post-hydration browser DOM snapshot captured via frameparse://browser-extractor.js (supports SPAs, auth sessions, Shadow DOM, iframes, real CSS visibility, and JS/cursor:pointer clickables).
urlstringLive webpage URL (http/https) to fetch and parse.

frame_read

Progressively read a single frame layer (1=Structure, 2=Text, 3=Interactables, 4=Actions) from a cached session. Layer 1 always returns the full landmark tree (paginate with offset/maxTokens). Layers 2–4 accept optional regions[] (Frame 1 IDs e.g. ['s4']) to scope content, plus maxTokens pagination.

ParameterTypeDescription
layer *integer1=Structure, 2=Text, 3=Interactables, 4=Actions.
sessionId *stringSession ID returned by frame_open.
effectsarrayOptional filter for Frame 4 action side-effect tiers.
kindsarrayOptional filter for Frame 2 block kinds or Frame 3 interactable kinds.
maxTokensintegerHard token budget for this response (default: 900). Use offset to paginate if truncated.
offsetintegerLine offset for pagination (default: 0).
regionsarrayOptional Frame 1 landmark IDs (e.g. ['s4']) — applies to layers 2–4 only; layer 1 ignores regions and always lists all landmarks.

frame_query

High-density zero-AI search across Frames 1-4 inside a cached page session. Returns only the matching text blocks, controls, and actions (~80-180 tokens) so the agent finds prices, labels, or buttons without reading the whole page.

ParameterTypeDescription
query *stringKeywords or phrase to locate (e.g. 'price', 'battery', 'warranty', 'login').
sessionId *stringSession ID returned by frame_open.
layersarrayWhich layers to search (default: [2, 3, 4]).
limitintegerMaximum ranked matches to return (default: 8).

frame_plan

Zero-AI deterministic action planner on Frame 4. Given a natural-language goal (e.g. 'search for laptops', 'add to cart', 'sign in'), returns ranked composite workflows & atomic actions with safety effect tiers, preconditions, parameters, and executable browser steps.

ParameterTypeDescription
goal *stringWhat the agent wants to accomplish on the page.
sessionId *stringSession ID returned by frame_open.
allowDestructivebooleanWhether to include destructive actions like delete/revoke (default: true; always confirm destructive actions with the user).
limitintegerMax ranked action plans to return (default: 5).
regionsarrayOptional Frame 1 landmark IDs to restrict candidate actions.

frame_inspect

Inspect the complete vertical cross-layer lineage (Frame 1 Structure <-> Frame 2 Text <-> Frame 3 Interactables <-> Frame 4 Actions) for any single ref ID (s#, t#, i#, w#, or a#).

ParameterTypeDescription
ref *stringAny frame reference ID such as s4, t2, i11, w1, or a3.
sessionId *stringSession ID returned by frame_open.

frame_diff

Compute a compact delta between the cached page session and a new page state (URL, HTML, or live browser DOM snapshot after clicking/submitting). Pass executedActionId (e.g. 'a5' or 'w1') to automatically learn and cache that control's real-world outcome on this origin for future Frame 4 parses.

ParameterTypeDescription
sessionId *stringExisting session ID to diff against.
executedActionIdstringOptional Frame 4 action/workflow ID (e.g. 'a5', 'w1') that caused this transition; records its observed effect into the site-level ActionEffectCache.
fixturestringOptional built-in fixture for after-state testing.
htmlstringNew raw HTML after the action.
snapshotobjectNew live browser DOM snapshot after the action.
updateSessionbooleanUpdate the cached session to the new state (default: true).
urlstringNew URL to fetch after the action.

frame_sessions

List active cached webpage sessions with cumulative token savings telemetry (raw HTML tokens avoided vs compact frame tokens emitted), or close a session.

ParameterTypeDescription
actionstringDefault: list.
sessionIdstringRequired when action is 'close'.

frame_browser

Connect FrameParse's built-in CDP actuator to Chrome (no DevTools uid required). Actions: status | connect | launch | disconnect | navigate. Prefer connect to an existing debugging port (http://127.0.0.1:9222).

ParameterTypeDescription
actionstringDefault: status. action=open navigates (optional url), extracts live DOM snapshot, and frame_open's it into a session.
browserURLstringChrome remote debugging HTTP endpoint, e.g. http://127.0.0.1:9222
executablePathstringChrome binary for action=launch.
headlessbooleanFor action=launch (default true).
profileDirectorystringChrome profile folder name (default: Default when useDefaultProfile is true).
sessionIdstringOptional session id for action=open.
urlstringURL for action=navigate or action=open.
useDefaultProfilebooleanFor action=launch: omit --user-data-dir so Chrome uses the OS default profile. Close all other Chrome windows first; CDP may be blocked on some Chrome builds.
usePersistentProfilebooleanFor action=launch (recommended): use %LOCALAPPDATA%/FrameParse/ChromeProfile — CDP works reliably and logins persist for marketing submissions.
userDataDirstringOverride Chrome --user-data-dir for launch.
wsEndpointstringDirect CDP WebSocket endpoint.

frame_act

Execute interaction(s) from FrameParse frames via CDP — click/fill/select/toggle/submit/navigate/hover/focus/type/press — using i# / a# / w# refs or a goal. Does NOT use DevTools a11y uids. Auto scroll-into-view before target ops. Re-extracts snapshot + returns frame_diff by default.

ParameterTypeDescription
sessionId *string
confirmDestructivebooleanRequired true to execute destructive Frame 4 actions.
goalstringIf ref omitted, run the top Frame 4 plan for this goal.
paramsobjectValues for fill/select/toggle/press (e.g. { q: "laptops", value: "...", key: "Enter" }).
refstringFrame ref to act on: i12 (interactable), a3/w1 (Frame 4 action/workflow), or s4 (scroll region).
reobservebooleanRe-extract live DOM and return frame_diff (default true).

frame_chain

Direct multi-step tool call chain in ONE invocation. Presets: orient_and_plan, query_then_inspect, plan_and_inspect, action_and_observe. Variables: $sessionId, $prev.ref, $steps.<alias>.*.

ParameterTypeDescription
compactboolean
jsonboolean
presetstring
presetArgsobject
stepsarray

frame_scroll

Scroll using FrameParse refs: into_view(ref), by(dx,dy), or to(top|bottom|x,y). Uses CDP actuator; reobserves by default.

ParameterTypeDescription
op *string
sessionId *string
dxnumber
dynumber
refstringi# / a# / s# for into_view or element scroll container.
reobservebooleanDefault true.
targetstringFor op=to without x/y.
xnumber
ynumber