agentleFS
engine9-aiengine9-ai/skills/e9-mcp/SKILL.md

e9-mcp

Skill1 starsChanged 3 months agoApache-2.0View on GitHub

Use the engine9 MCP server — log in first via mcp_auth, MCP-only discovery (never local code), prefer native tools over task. Plugin install/settings are first-class MCP `plugin` (see e9-plugin), not task. Use @engine9/plugins/e9workers:EchoWorker + echo for on-demand smoke tests (no plugin lookup), discover other plugin methods via account, and invoke task as the catch-all for worker execution.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

34 rules. About 0 are common, 11 are distinctive, and 23 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 23

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Rule: Every /e9 or MCP request starts by logging in.

    line 32
  2. Very specific:

    Call mcp_auth on the engine9 MCP server with {}.

    line 34
  3. Very specific:

    Call ok, then user, to confirm signed in.

    line 36
  4. Very specific:

    If user already succeeds this session, skip to step 4.

    line 39
  5. Distinctive:

    After login, if MCP tools still fail, see e9-cli — troubleshooting.

    line 50
  6. Distinctive:

    Rule: Stop the current workflow on an MCP error unless the response explicitly marks it safe to retry automatically.

    line 56
  7. Very specific:

    When diagnosing timeline or model results, read sql first.

    line 93
  8. Distinctive:

    When any of these is true, stop the current workflow immediately and report the error to the user.

    line 97
  9. Distinctive:

    Do not retry automatically or call downstream tools as a workaround.

    line 114
  10. Very specific:

    Do not guess plugin paths or methods when account failed — plugin discovery did not succeed.

    line 115
  11. Very specific:

    Do not open accounts.d/, accounts.compiled.json5, account-config.json, account.<id>.json5, .e9_parameters, or any other local catalog to …

    line 116
  12. Very specific:

    When interacting with an engine9 MCP server, discover capabilities and accounts exclusively from the MCP server.

    line 144
  13. Distinctive:

    Rule: If MCP does not return an account, plugin path, method, or option, report that result and do not guess or search local catalogs.

    line 146
  14. Distinctive:

    When an account or parent is not found, do NOT dig deeper into compiled account catalogs, etc.

    line 165
  15. Distinctive:

    If a path, method, or option is not present in MCP responses, report that to the user — do not guess from local code.

    line 186
  16. Very specific:

    Rule: Use a native MCP tool whenever it covers the request with equal or better fidelity.

    line 192
  17. Distinctive:

    Use this when a screen needs signup, disabled date, and which months an account was active.

    line 301
  18. Very specific:

    All commands include top-level sql: [{ id, sql, error, table?

    line 514
  19. Very specific:

    Do not join person.id to person_id_int.

    line 554
  20. Very specific:

    Read a small slice of an account file via FileWorker.stream (local, s3://, r2://, gs://).

    line 760
  21. Very specific:

    Do not schedule createApiKey via task.

    line 785
  22. Very specific:

    Every bootstrapped account has @engine9/plugins/e9workers.

    line 812
  23. Distinctive:

    When the user's request does not map cleanly to a native tool:

    line 840
  24. Very specific:

    Do not invent paths or methods for account plugins — only use combinations present in the account response.

    line 854
  25. Very specific:

    Do not use remote-legacy dotted paths (channelbots.RENxtBot.People).

    line 864
  26. Distinctive:

    No native tool for this specific plugin method → fallback path.

    line 870
  27. Very specific:

    Call account with { "account_id": "<account_id>" }.

    line 871
  28. Very specific:

    When the user asks for all accounts, parent children, or other multi-account remote flow-run views (e.g.

    line 891
  29. Very specific:

    Do not call account plugins (or any account-DB worker) once per child to “check access”.

    line 893
  30. Very specific:

    Do not use the first id in a parent/all list as a required DB-connected account_id before the remote list.

    line 894
  31. Distinctive:

    After Step 0 — Log in:

    line 1008
  32. Very specific:

    Call user to confirm signed-in identity and account access.

    line 1010
  33. Very specific:

    If account id is unknown, call account with command: "search" and the known filters (prefix/parent/plugin).

    line 1011
  34. Very specific:

    Call search with a known email to validate account-scoped data access.

    line 1012

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

engine9 MCP

The engine9 MCP server exposes authenticated, account-scoped tools for discovery, queries, reporting, API-key management, and asynchronous work. Use this skill when selecting and calling engine9 MCP tools from Cursor or another MCP client. Plugins are first-class: install, catalog, and settings use native MCP plugin — never task. Fleet install steps: e9-plugin.

Quick reference

NeedUse
Authenticatemcp_auth with {}, then verify with ok and user
Install a plugin / list installable pathsplugin install / listAvailable — e9-plugin
Discover accounts or installed pluginsaccount
Child-account history for billing (signup, disabled, active months)account search with history: true
Set an account's default warehouseaccount command: setDefaultWarehouse with remote_plugin_id
Use a purpose-built operationThe matching native MCP tool
Run an on-demand worker methodtask with path + method
Run a predefined flowtask with flow_id
Diagnose generated queriesThe response's top-level sql field
Debug an input (table, recent store files, record count and sample)input — Input. Caller supplies input_type
Legacy report foldersDo not call unless the user explicitly asked. Never code reports against them. Legacy report folders

Rule: Discover accounts, plugins, methods, and options from the connected MCP server only; never infer them from local workspace code.

Roles: Operators are read-only in SQL (SELECT/WITH) and schedule published flows (flow_id / flow_path); on-demand path+method, API keys, plugin install/settings, and legacy report-folder writes (ensureChild, setVisibility) need the admin role (user.accounts[id].level).

Step 0 — Log in (always first)

Rule: Every /e9 or MCP request starts by logging in. Do not grep, curl, read config files, start servers, or run CLI commands to "figure out" auth.

  1. Call mcp_auth on the engine9 MCP server with {}.
  2. Cursor opens a sign-in prompt for the user — wait for them to complete it.
  3. Call ok, then user, to confirm signed in.
  4. Proceed with the user's request.

If user already succeeds this session, skip to step 4.

Login is only mcp_auth → user completes prompt → verify with user. Nothing else.

Do not use for loginWhy
Shell commands (curl, grep, npm run mcp, …)Not login; wastes time
Reading mcp.json, STATUS.md, .env, local configNot login
e9 oauth token, local CLI, repo worker codeWrong path for Cursor MCP
Reporting "MCP unavailable" before mcp_authAlways try mcp_auth first

After login, if MCP tools still fail, see e9-cli — troubleshooting.

MCP tool errors — stop immediately

engine9 MCP tools return failures with isError: true (MCP standard) plus optional structuredContent:

Rule: Stop the current workflow on an MCP error unless the response explicitly marks it safe to retry automatically.

FieldMeaning
statustimeout, unauthorized, validation, or error
requiresUserNotificationUser should be told about this failure
safeToRetryAutomaticallyWhen false, do not retry or route around the error

Success responses use JSON text in content with { ok: true, ... }. Failures use plain text in content (not { ok: false } JSON).

Executed SQL (sql)

Tools that run warehouse SQL include a top-level sql field so you can debug without reconstructing statements. Prefer this over guessing SQL.

Array form (timelinePerson and any multi-query tool):

{
  "ok": true,
  "sql": [
    { "id": "person_email", "table": "person_email", "sql": "SELECT …", "error": null },
    { "id": "timeline", "table": "timeline", "sql": "SELECT …", "error": null }
  ]
}
FieldMeaning
idLabel for the statement
sqlStatement text, or null if it was not generated
errornull on success, "skipped" if not run, or the failure message
tableOptional primary table

Omit sql only when the tool did not execute SQL. Empty [] means the tool could have queried but did not.

String form (eql, sql command: query): sql is the single statement string — equivalent to [{ "id": "query", "sql": "<statement>", "error": null }]. SELECT/WITH queries are hard-capped at 10000 rows (LIMIT rewritten before execution). Responses include max_rows and truncated.

When diagnosing timeline or model results, read sql first. Do not re-invent those SELECTs via the sql tool unless you need a variant.

Hard stop — do not continue

When any of these is true, stop the current workflow immediately and report the error to the user. Do not call further account-scoped tools (task, search, eql, sql, analyze, segment, inventory, timelinePerson, timelinePersonLegacy, chat, file, apiKey, report, legacyReportFolder, plugin, etc.).

Exception — fleet plugin install: a per-account MCP plugin install failure (Cannot connect to the … database, Not authorized for account, unmet dependencies) is a skip for that account_id only. Continue remaining accounts and report successes and failures. Session-level auth failure and getPluginMetadata still stop the whole job. See e9-plugin.

  1. Tool result has isError: true
  2. Response text matches a fatal pattern (even when only plain text is visible):
    • Cannot connect to the <account_id> database
    • Not authorized for account
    • Authentication required
    • getPluginMetadata (e.g. worker.getPluginMetadata is not a function)
  3. MCP account did not return parseable { ok: true, plugins: [...] }
  4. structuredContent.safeToRetryAutomatically is false
  5. An account or parent is not found in MCP: user.accounts is empty, account search count is 0 for that id/parent/prefix, or plugins says the account is unknown/unauthorized. Stop. Do not dig deeper into compiled account catalogs, etc. Account discovery when using MCP should only be through that MCP, not through any other mechanisms.

What to do on stop

  1. Report the MCP error message verbatim to the user (or that MCP user / account search did not find the account or parent).
  2. Do not retry automatically or call downstream tools as a workaround.
  3. Do not guess plugin paths or methods when account failed — plugin discovery did not succeed.
  4. Do not open accounts.d/, accounts.compiled.json5, account-config.json, account.<id>.json5, .e9_parameters, or any other local catalog to “find” ids MCP did not return.
  5. For Cannot connect to the <account_id> database: the account database is unreachable; every account-scoped operation on that id will fail the same way until connectivity is restored. Fleet plugin install skips that id and continues (e9-plugin).
  6. For getPluginMetadata: plugin metadata loading is broken on this server. Abort. That must be fixed before continuing — do not schedule via local TaskWorker, SQL plugin / bot_metadata lookups, guessed plugin_id/submodule paths, or the REST Task API as a workaround. account plugins and task schedule both depend on it.

Examples

Database unreachable (status: timeout):

Cannot connect to the <account_id> database

Unauthorized account (status: unauthorized):

Not authorized for account <account_id>

Plugin metadata missing (account plugins or task schedule):

worker.getPluginMetadata is not a function

In all cases: stop. Do not call task or other account tools afterward. For getPluginMetadata, tell the user it must be fixed before any plugin discovery or scheduling can continue.

MCP-only discovery — do not use local code

When interacting with an engine9 MCP server, discover capabilities and accounts exclusively from the MCP server. Do not search, read, or infer behavior from local workspace code (server/workers/, plugins/, interfaces/, etc.).

Rule: If MCP does not return an account, plugin path, method, or option, report that result and do not guess or search local catalogs.

Local code is an unreliable source for MCP work because:

  • The connected MCP server may be a different deployment, version, or branch than the workspace on disk.
  • Plugin installs and metadata are account-specific — only MCP account reflects what is installed for the target account.
  • Worker allowlists, tool schemas, and routing (remote, workers/... vs plugin paths) are enforced by the running server, not by files in the repo.
  • Method names, option keys, and paths in local source may be deprecated, renamed, or not exposed via MCP at all.

Accounts and parents — MCP only

Account discovery when using MCP should only be through that MCP, not through any other mechanisms.

NeedMCP source
Who am I / which accounts can I use?user (accounts flat map with parent_ids)
Find accounts by prefix, parent, name, type, tags, pluginaccount command: "search" (one call; flat rows with same listing fields)
One account’s plugins / methodsaccount command: "plugins"

When an account or parent is not found, do NOT dig deeper into compiled account catalogs, etc. Do not read accounts.d/, accounts.compiled.json5, account-config.json, account.<slug>.json5, .e9_parameters, .e9_config.json5, or account trees on disk. Report that MCP did not return the account or parent, and stop.

Use these sources instead:

NeedSource
Available MCP tools and parametersMCP tool schemas (client tool descriptors for the connected server)
Account ids, names, parentsMCP user / MCP account search only
Installed plugins, submodules, methodsMCP account → plugins[].metadata
Installable package paths on this serverMCP plugin command: "listAvailable"
Install a package on an accountMCP plugin command: "install" — e9-plugin
Plugin settings (types, descriptions, current values), grouped by pluginMCP plugin command: "settings" (PluginWorker.listSettings)
Schema / tables / indexes / raw SQLMCP sql (command: query, describe, indexes, tables, info, histo, compile_eql)
Schedule or check async workMCP task: on-demand = path+method (@engine9/plugins/e9workers:EchoWorker needs no account lookup); predefined flow = flow_id slug
Analyze / summarize table contents (min, max, distinct, samples)MCP analyze (uses tables then analyze; optional target_buckets)
Account / person current timeline + identity / model healthMCP timelinePerson (command: inspect)
Account / person legacy timeline_v3* inspectMCP timelinePersonLegacy (separate tool; not inspect + legacy)
Compare current model_*_stats by source codeMCP timelinePerson (command: compareSourceCodes). Legacy pivot: e9-model/legacy.md, only when the user explicitly asked for legacy
Date histogram on a datetime column (index optional)MCP sql with command: "histo"
List flow definitions (REST)Task API GET /flows — see e9-tasks-api

If a path, method, or option is not present in MCP responses, report that to the user — do not guess from local code.

Tool selection strategy

Prefer explicit native MCP tools when there is a quality match. Only fall back to task when no native tool covers the request.

Rule: Use a native MCP tool whenever it covers the request with equal or better fidelity; treat task as the catch-all.

User intentPrefer
Am I connected / signed in?ok, then user
Who am I / which accounts do I have?user (flat accounts map with parent_ids)
Find accounts by prefix, parent, type, tags, or installed pluginaccount with command: "search" (one call — do not fan out; flat rows)
Child accounts with signup and disabled dates, including disabled accountsaccount search with parents, history: true, and limit: 500. See Account history
List plugins / methods on one accountaccount with account_id (or command: "plugins")
Set an account's default warehouseaccount command: "setDefaultWarehouse" with remote_plugin_id (plugin.remote_plugin_id). The JSON API body is bot_id; the account stores default_warehouse_bot_id. Do not send bot_id or default_warehouse_bot_id
List plugin settings (types, descriptions, current values) grouped by pluginplugin with command: "settings"
Install a plugin on one account or a parent’s childrenplugin install — e9-plugin. Do not use task
Search people by email, phone, name, or idsearch
Search people in or out of a current model by source codesearch with a searchOptions clause — e9-model — Person search
Search people in a legacy model and out of the current modele9-model/legacy.md — only when the user explicitly asked for legacy
List available person-search form options for an accountsearchOptions
Account / person current timeline + identity / model healthtimelinePerson (command: inspect)
Account / person legacy timeline_v3* inspecttimelinePersonLegacy
Compare current model_*_stats by source codetimelinePerson with command: "compareSourceCodes". Legacy pivot: e9-model/legacy.md, only when the user explicitly asked for legacy
List segments, load segment detail, or schedule segment buildssegment
List or run reports (plugin path or portable JSON definition; filters, date range)report (list first for plugins; run with path or definition). This is the only report system to code against
Legacy stored report foldersDo not use unless the user explicitly asked. legacyReportFolder is not a report to code against. Legacy report folders
Read or schedule account warehouse inventoryinventory (get first; build only if not ready)
Debug an input: list the input table, recent store files, file record count and sampleinput (list, files, summary). Caller supplies input_type; the tool does not catalog types
Create accounts / manage domains or domain secretse9-account Worker (cloud-services/e9-account) — not MCP
Run a SQL/EQL queryeql / sql (command: "query" or omit when sql is set)
Analyze / summarize a tableanalyze
Describe tables, indexes, list tables, histosql with command: "describe" / "indexes" / "tables" / "histo"
Compute plugin or input UUIDsplugin_id, input_id
Chat / conversation historychat
Read a small slice of an account file (S3 / local)file
List inputs, recent store files, or a file sampleinput (list / files / summary). input_type is an exact filter the caller supplies
Create / list / update / rotate / revoke API keys and scopesapiKey — see e9-api-key. Never via task
Run an on-demand plugin methodtask with path + method. Built-in: @engine9/plugins/e9workers:EchoWorker + echo (no account lookup). Other plugins: discover via account first
Run a published flow (predefined)task with flow_id (slug from REST GET /flows) — no path/method
Archive or retry flow runs / job liststask with action: "archive" or bulk "retry" (flow_run_ids). One call for all ids. After a parent/all list, pass the same parent_account_id — bulk archive
Pause / resume / retry a task run, edit options, fetch log/output/checkpointstask with action: "pause" / "resume" / "retry" (task_run_id) / "updateOptions" / "log" / "output" / "get" (checkpoints only on get). To walk back checkpoints: action: "resetCheckpoints" with start_index (0 / omitted clears all; N keeps the first N — cannot yank from the middle)
Method option schema for a plugin path (Options form)task with action: "describe" and path (same naming as schedule; method optional)

task is the catch-all for behaviors that do not have a native MCP call. Do not reach for task when a native tool already covers the request with equal or better fidelity.

Available MCP tools

These are the native tools registered on the engine9 MCP server (excluding task):

ok

Returns server status, current time, and whether the request is authenticated. No sign-in required.

user

Returns the current authenticated user: uid, email, admin flag, and a flat account access map. Each accounts[account_id] entry shares listing fields with account search: name, type, parent_ids, disabled, tags, plus auth level. No nested children — rebuild hierarchy from parent_ids on the client. Prefer this over task for identity and full account-list questions. See How MCP lists accounts.

account

Three commands:

command: setDefaultWarehouse — set the account's default warehouse. Send remote_plugin_id (plugin.remote_plugin_id for the warehouse plugin). The tool posts { "bot_id": "<remote_plugin_id>" } to POST /jsonapi/account/:id/default_warehouse on the data layer (same host and auth as the Task API). The account stores that value as default_warehouse_bot_id. Sending bot_id or default_warehouse_bot_id is rejected.

  • Required: account_id, remote_plugin_id
  • Returns: { ok: true, command: "setDefaultWarehouse", data: { id, bot_id, default_warehouse_bot_id } } — data.bot_id is the JSON API echo of remote_plugin_id
{ "command": "setDefaultWarehouse", "account_id": "<account_id>", "remote_plugin_id": "frakturedb_hxq" }

command: plugins (default when account_id is set) — list plugins installed on one account with marketplace metadata merged onto each plugin.

  • Required: account_id
  • Returns: { ok: true, command: "plugins", plugins: [...], default_warehouse_bot_id } — each plugin includes path, DB fields, and metadata (alias, submodules, methods, auth_fields, …). default_warehouse_bot_id is the catalog default warehouse (plugin.remote_plugin_id, or null). It is read-only on this command; change it with setDefaultWarehouse
  • Backward compatible: { "account_id": "<id>" } still means plugins.

command: search — find accessible accounts in one call using config filters and optional installed-plugin probes. Prefer this over user + many per-account plugin loads when the question is “which accounts match …?”.

  • Requires at least one filter: prefix / prefixes, parents, ids, name, type, tags, or plugins
  • Optional: recursive (with parents), include_disabled, history, include_plugins, include_plugin_metadata, limit (default 50), max_scan (default 100 for plugin probes), concurrency
  • Returns: { ok: true, command: "search", count, accounts: [...], warnings, filters, truncated* }
  • Each accounts[] row is flat with the same core fields as user.accounts (name, type, parent_ids, disabled, tags) plus account_id. parents / recursive only filter which rows appear; they do not nest children.
  • include_plugins attaches lite plugin rows (id / name / path / table_prefix) per account. include_plugin_metadata adds one marketplace metadata map keyed by plugin path — do not fan out command: plugins per account to build a method catalog.
  • plugins filter matches installed plugin path / name / table_prefix substrings (e.g. ["acoustic"]). Apply prefix/parents first so DB probes stay bounded.
  • Per-account DB failures go into warnings (do not fail the whole search).
  • count: 0 is the answer. Do not fall back to compiled account catalogs to find ids MCP omitted.

Example — accounts matching a prefix with a plugin installed:

{ "command": "search", "prefixes": ["<prefix>"], "plugins": ["acoustic"] }

Example — direct children of a parent (flat list):

{ "command": "search", "parents": ["<parent_account_id>"] }

Example — those children with enable/disable history, including disabled accounts:

{ "command": "search", "parents": ["<parent_account_id>"], "history": true, "limit": 500 }

history is honored on command: "search" only. Plugins and setDefaultWarehouse ignore it.

Plugins command is also the discovery step before calling task when no native tool matches (see fallback workflow below).

Account history

Rule: Leave history off unless the caller needs enable/disable dates. history: true includes disabled accounts and calls the Frakture account export for every matched account.

Use this when a screen needs signup, disabled date, and which months an account was active. Ordinary search does not call the Frakture export.

history: true forces include_disabled: true. Each row then includes:

FieldMeaning
disabledCurrent Frakture flag when history_status is ok. Otherwise the catalog flag
date_createdISO-8601 signup date. From account.date_created, or the earliest Frakture history row marked created when that field is missing. null when neither exists
last_disabledISO-8601. null when the account has never been disabled
last_enabledISO-8601. null when the account has never been enabled
enable_disable_historyOldest first. { date, disabled, created?, last_disabled?, last_enabled?, user_id? }. When date_created is set, the first event is { date: date_created, disabled: false, created: true }. The rest are enable/disable updates only; renames and settings changes are omitted
history_statusok, missing (no export row), or error (the export call failed)

filters.history is true. warnings lists export failures. A failure does not fail the search. limit still caps the catalog page at 500; check truncated and total_matched.

Direct parents with no other filters uses GET /jsonapi/account?parent_id=&disabled=all (no X-Account-Id). That list is direct children only and includes disabled accounts. A disabled account on that export that is not in the catalog is still returned. Other searches use GET /jsonapi/account/:id per returned account.

Rule: Signup is date_created when it is set. The matching created: true event starts the history, so the first row below applies. Use the other rows only when date_created is null.

SituationSignupDisabled dateActive in a month
Earliest history event has disabled: false (including the created: true event)That event’s datelast_disabled when disabled is true, otherwise blankFrom that enable until the next disable. A later enable starts again. An open interval runs through now
Earliest event has disabled: trueBefore that date (already enabled; creation was not returned)That disable, and last_disabled if still disabledFrom the start of the chart through the month before the disable, then any later enable/disable pairs
No history events, last_enabled set, account enabledlast_enabledblankFrom last_enabled through now
No history events, last_disabled set, account disabledBefore last_disabledlast_disabledThrough the month that contains last_disabled when the disable is after the first instant of the month. A disable at YYYY-MM-01T00:00:00.000Z does not count that month
No dates, account enabledUnknownblankCurrent month only
history_status is missing or errorUnavailableCatalog disabled onlyLeave the account out of monthly counts

A month counts when any active interval overlaps it. Interval end is exclusive: disabled at the first instant of a month means that month is not billable.

Conductor artifact billing (/billing) renders this for direct children of the current parent. All-accounts scope asks for a parent first. The screen charts active accounts by month and lists signup, disabled date, and billable months in the chart window.

plugin

Fast path: e9-plugin — install is native MCP plugin, not task.

Install plugins and catalog declared settings for an account via PluginWorker. Settings are warehouse configuration on a plugin row (setting table). They are not marketplace authorization (auth_fields on account plugin metadata).

  • Required: account_id, command
  • listAvailable — installable package paths on this server (server-wide catalog; any accessible account_id works)
  • install — install path (full package path or shorthand from listAvailable). One call per account. Unique packages reuse the existing row
  • settings — catalog grouped by plugin path: path, name, plugin.instances, JSON Schema form, settings[] (type, description, values, default, current value). Optional path / plugin_id. Hidden settings omitted unless include_hidden: true. Compile failures go in errors (call still succeeds)
  • setSetting — update one warehouse value. Required: plugin_id, name. Validates values / type when the package declares that name

Example — install:

{
  "command": "install",
  "account_id": "<account_id>",
  "path": "@engine9/plugins/models/deployment/v2026_09_16"
}

Example — settings UI catalog:

{ "command": "settings", "account_id": "test" }

Example — update a declared setting:

{
  "command": "setSetting",
  "account_id": "test",
  "plugin_id": "<plugin uuid>",
  "name": "summary_model_kind",
  "value": "current"
}

HTTP: GET /data/settings, POST /data/settings. Fleet install: e9-plugin. Authoring: create-engine9-plugin.

search

Person search by metadata filters and/or a plugin search tree. Prefer this over ad-hoc SQL or task when looking up people by email, phone, name, or id. Returns person summaries with related records; each related subsection (emails, phones, addresses, person_remote, transactions) includes a total count and up to 100 sample records.

  • Required: account_id
  • Filters (string or array each): emails, person_ids, phones, given_names, last_names
  • Optional: search — plugin search tree from searchOptions, e.g. { and: [{ path: "@engine9/interfaces/person_email:search:emails", options: { emailMatch: "a@" } }] } (merged with metadata filters using AND)
  • Optional: limit (max 1000, default 10)
  • Returns: { ok: true, result } where result is the PersonWorker.search payload

Example — email lookup:

{ "account_id": "test", "emails": ["foo@bar.com"], "limit": 10 }

Example — plugin clause from searchOptions:

{
  "account_id": "test",
  "search": {
    "and": [
      {
        "path": "@engine9/interfaces/person_email:search:emails",
        "options": { "subscriptionStatus": "Subscribed" }
      }
    ]
  },
  "limit": 10
}

For /e9 search … token parsing (emails vs person_ids vs names), see e9-cli — /e9 search parsing rules.

Model source-code membership

People in or out of a current model for a source code use the installed model's searchOptions handlers, not ad-hoc SQL. Full paths, forms, and the include/exclude tree: e9-model — Person search.

IntentClause
In the model's person credit for a code{ path: "@engine9/plugins/models/<model>:search:personSourceCode", options: { sourceCode } }
Out of that creditSame clause with exclude: true
In person credit vs has a credited transactionpersonSourceCode vs transactionSourceCode — different handlers

<model> is first_touch, crm_origin, or last_acquisition. sourceCode containing % is LIKE. exclude is set on the clause; it is not a form property.

Rule: People in a legacy model for a source code, and out of the matching current model, are e9-model/legacy.md. Read that file only when the user explicitly asked for legacy models. Do not add @engine9/plugins/models/legacy:search:personSourceCode otherwise, even if searchOptions lists it.

searchOptions

Per-account catalog of person-search options for building a UI form. Call this before constructing advanced plugin searches; submit resulting { path, options } clauses to search (or POST /data/search). Set exclude: true on a clause for people outside that handler; exclude is not a form field.

  • Required: account_id
  • Returns: { ok: true, account_id, standard, searches, errors }
    • standard — fixed filters (emails, phones, given_names, last_names, person_ids, limit) as JSON Schema
    • searches — handlers from installed plugins: path, title, canonical form, plugin.instances. Current model source-code forms (personSourceCode, transactionSourceCode) are in e9-model — Person search. The legacy model form is in e9-model/legacy.md and is used only when the user explicitly asked for legacy.
    • errors — per-plugin compile failures (does not fail the whole call)

Example:

{ "account_id": "test" }

report

List, load, or run reports for an account. This is the only report system to code against. Plugin reports come from installed plugins (<package>:reports:<key>). command: run also accepts a portable JSON definition (hosted or inline). SQL is generated by ReportWorker. Full authoring + UI widget contract: e9-reports. Legacy stored folders are a different tool and are not a schema: legacy report folders.

  • Required: account_id
  • command: list (default) — catalog of installed plugin reports: path, name, description, tags, plugin.instances, filters (JSON Schema), component summaries
  • command: get — definition without running. Requires path
  • command: run — execute path or definition with options / start / end / limit / offset. Returns component data plus top-level sql. Mutually exclusive locators.

Example list:

{ "account_id": "<account_id>" }

Example run (plugin path):

{
  "command": "run",
  "account_id": "<account_id>",
  "path": "@engine9/plugins/reports/people:reports:subscription_status",
  "limit": 1000
}

Example run (inline definition):

{
  "command": "run",
  "account_id": "<account_id>",
  "definition": {
    "name": "People count",
    "data_sources": { "default": { "table": "person" } },
    "sections": [
      {
        "components": [
          { "id": "people", "component": "StatCard", "name": "People", "metric": { "eql": "count(*)" } }
        ]
      }
    ]
  }
}

HTTP: GET /data/reports, GET /data/reports/get?path=, GET|POST /data/reports/run (path or POST definition).

legacyReportFolder

Legacy stored report folders. Not plugins. Not the report tool. Do not call unless the user explicitly asked to list, read, or change visibility of a legacy report folder. Do not author, query, or code reports against the response. A small number of legacy accounts still open these folders; that is the only reason the tool exists.

Full contract, folder fields, and examples: legacy report folders. Open that file only for an explicit request.

  • Required: command, account_id
  • command: list — stored folders. include_standard: true also returns compiled standard slug parents
  • command: get — one stored folder by id (stored id or short). A standard slug is rejected
  • command: ensureChild — create or flip the one child of folder_id (stored id, short, or standard slug) with visibility public or private. Admin role. target_account_id, when sent, must equal account_id
  • command: setVisibility — set public or private on a stored id. Admin role

A public folder makes every report in it available without a per-report sign-in. A private folder does not. Success always includes legacy: true and a warning. Do not code against data.

timelinePerson

Account- or person-level current-identity timeline + model inspect (ModelWorker.inspectPerson) and source-code model compare (compareSourceCodes). SQL lives on the server; prefer this over ad-hoc SQL. The conductor Timeline artifact is a shell over command: inspect; /model is a shell over command: compareSourceCodes. There is no separate auditPeople tool — inspect includes those current aggregations.

Rule: inspect never loads timeline_v3*. Call timelinePersonLegacy for legacy tables. Current vs legacy contract: e9-timeline — MCP: current vs legacy.

  • Required: account_id
  • command: inspect (default) — omit emails / person_ids / source_codes for an account-wide load (entry-type min/max/count, identity table counts, transaction min/max, model_*_person / model_*_transaction counts — not *_stats). Person-scoped (person_ids / emails) returns timeline detail + model_*_person only and skips those account audit COUNTs. person_ids is a number, string, or array of either (warehouse person.id is an integer — do not stringify). Optional source_codes (comma-delimited; % is LIKE) filters those queries. Missing tables are skipped. Do not join person.id to person_id_int.
  • command: compareSourceCodes — all current model_*_stats by source code (person_count, revenue, transactions). Omit source_codes to union each model's top 10 by people and by revenue. Optional models subset. Returns sql for top-N selection and per-model stats. Pivot stems and legacy: true are in e9-model/legacy.md; use them only when the user explicitly asked for legacy.
  • command: compareSourceCodesLegacy — legacy pivot vs current. e9-model/legacy.md. Only when the user explicitly asked for legacy.
  • command: summarizeSourceCodesLegacy — pivot rows only. e9-model/legacy.md. Only when the user explicitly asked for legacy.

All commands include top-level sql: [{ id, sql, error, table? }] — the statements executed for this request. Use that log when debugging inspect/compare results.

Example — account-wide inspect (current aggregations):

{ "account_id": "test" }

Example — person inspect (current only):

{ "account_id": "test", "emails": "user@example.com" }

Example — person inspect by numeric person.id:

{ "account_id": "test", "person_ids": 1517 }

Example — auto top source codes across current models:

{ "account_id": "test", "command": "compareSourceCodes" }

Example — specified source codes:

{ "account_id": "test", "command": "compareSourceCodes", "source_codes": "EM_%,MAIL" }

timelinePersonLegacy

Legacy-identity timeline inspect (ModelWorker.inspectPersonLegacy). Separate tool from timelinePerson so the UI can load it independently (or not at all) and so it can be unregistered later.

  • Required: account_id
  • Optional: emails, person_ids (current person.id — email lookup only), source_codes, row_limit, people_limit
  • Account-wide: timeline_v3 min/max/count, transaction_model_source_code. person_model_source_code totals are skipped (no account-wide COUNT)
  • With email / person_ids / source_codes: person_model_source_code totals by model; with email also person-level timeline_v3_summary / person_model_source_code. Type column is entry_type_label
  • Do not join person.id to person_id_int. Future deployments will drop this tool.

Example — person legacy timeline:

{ "account_id": "test", "emails": "user@example.com" }

Example — account-wide legacy aggregations:

{ "account_id": "test" }

segment

List or load rows from the account segment table, or schedule SegmentWorker.buildSegmentPersonFile. Do not use legacy global_segment. There is no free-text filter — list → match in the agent → detail.

  • Required: account_id, command (list, detail, or build)
  • list — summary rows from segment joined to plugin (plugin_name, plugin_path). Structured filters only: plugin_id, plugin_path, segment_id / segment_ids, remote_segment_ids, build_type, submodule, fields. Optional fields: '*' for all columns. Returns sql.
  • detail — full segment row(s) plus plugin_name / plugin_path. Requires segment_id or segment_ids. Returns sql.
  • build — enqueue a segment person-file build. Requires segment_id or definition_path. Optional: plugin_id, filename, engine, duckdb_file, input_id, label, remote.

Example list:

{ "command": "list", "account_id": "test" }

Example list by plugin path:

{ "command": "list", "account_id": "test", "plugin_path": "@engine9/interfaces/channels/email" }

Example detail after matching a listed row:

{ "command": "detail", "account_id": "test", "segment_id": "<uuid>" }

Example build by definition path:

{
  "command": "build",
  "account_id": "test",
  "definition_path": "@engine9/interfaces/channels/email:segments:email_openers_30d"
}

inventory

Account warehouse inventory cache at {account root}/cache/inventory.json.gz. Prefer this over task for inventory. Reports take a long time to build — always get first.

  • Required: account_id
  • command: get (default) — InventoryWorker.inventory. Status only: if the gzip cache exists, ready: true plus path / size / modified_at. Does not parse the file. If not: ready: false (do not retry get as a workaround — offer build). Full report: GET /data/inventory/report (gzip bytes, 204 if missing) or MCP file with filename: cache/inventory.json.gz.
  • command: build — schedule InventoryWorker.buildInventorySummaryFile via TaskWorker. Optional: definition_path, tables, extra_tables, exclude_tables, input_directories, include_files, statistics, label, remote. Standard builds omit input-store files. Does not wait for the report.

Example get:

{ "account_id": "test" }

Example build:

{ "command": "build", "account_id": "test" }

Account / domain management (e9-account)

Account creation and domain secrets are not MCP tools. Use the e9-account Cloudflare Worker (cloud-services/e9-account):

  1. Auth with Delegate (GET /auth/login → /auth/delegate)
  2. POST /v1/accounts/create — optional { slug, name, backend }; returns endpoints + public_api_key (not shared secret)
  3. GET /v1/accounts/:slug/shared-secret — same owner only

Canonical store: ACCOUNT_REGISTRY D1. KV: DOMAINS_KV + DOMAIN_API_KEYS.

eql

Runs a SELECT built from an EQL object and returns generated SQL plus query rows. Hard-capped at 10000 rows: a missing or larger eql.limit is rewritten before execution. Responses include max_rows and truncated.

  • Required: account_id, eql (query object with table, columns, conditions, etc.)

For EQL expression fragments (not a full query), use sql with command: "compile_eql" instead.

Full EQL syntax, query-object shape, and samples: e9-eql.

sql

Realtime SQL and schema introspection via SQLWorker (replaces the former worker_invoke allowlist).

commandPurpose
query (default when sql is set)Execute a single SQL statement. SELECT/WITH are hard-capped at 10000 rows (LIMIT rewritten before execution); truncated when the cap is hit
describeColumn schema for table
indexesIndexes for table
tables (default when sql omitted)List/filter table names (filter, includeTemp, …)
infoDriver/dialect info
histoDate histogram on a datetime column (index not required; default prefers indexed)
compile_eqlEQL expression → SQL fragment (eql + table)

Examples:

{ "account_id": "test", "sql": "select 1" }
{ "account_id": "test", "command": "describe", "table": "person" }
{ "account_id": "test", "command": "tables", "filter": "person" }
{ "account_id": "test", "command": "histo", "table": "transaction", "column": "ts" }

There is no worker_invoke tool. Plugin methods still use task (async).

analyze

Analyzes table contents via SQLWorker.analyze. Prefer this over hand-written MIN / MAX / COUNT(DISTINCT) when the user wants a summary of a SQL table. Column-stat contract, sample limits, and the date-histogram overwrite rules: e9-eql — Analyzing a table.

  • Required: account_id, table (passed to SQLWorker.tables({ filter }))
  • Optional: max_tables (default 3, max 10), target_buckets (default 10; date histogram only)
  • Workflow:
    1. tables({ filter }) — regex first; if no matches, language-token fallback on filter
    2. analyze on each matched table (sample + optional histo in parallel)

Response: { ok, filter, matched_tables, analyzed_tables, truncated, analyses }. Each analysis is { table, records, table_records, columns }. table_records is count(*). Column stats live on columns; histogram buckets are merged onto those same objects.

Column fieldMeaning
name, typeColumn name and inferred type (string, int, bigint, double, decimal, date, datetime, uuid)
min, maxSample range. When a histogram runs, every datetime column is replaced with full-table SQL min/max
emptyNull or missing values in the sample
distinctDistinct values seen in the sample
sampleUp to 32 most frequent sample values (stringified)
min_length, max_lengthPresent on string columns
bucketsOn datetime columns when a histogram runs: { range, start, end, records, min, max }
bucket_columntrue on the histogram column (ts, then created_at, then modified_at, else the first indexed datetime leading column)
bucket_unitday, week, month, quarter, or year

Rule: table_records is count(*). Sample min / max / distinct / empty / sample / records cover up to 10000 rows (5000 from the start plus 5000 highest primary-key rows when a primary key exists). They are not full-table aggregates. Histogram MIN / MAX and buckets[].records on datetime columns are full-table. analyze only auto-runs the histogram when an indexed datetime column exists; for unindexed dates use sql command: "histo" with an explicit column.

Standalone date histograms: sql with command: "histo". Schema-only: sql describe / indexes / tables.

Example — user says "Summarize the ROI transaction table" → call analyze:

{ "account_id": "test", "table": "ROI transaction", "target_buckets": 10 }

plugin_id

Computes plugin_id from account_id and remote_plugin_id.

input_id

Computes input_id from plugin_id and remote_input_id.

chat

Store and replay account-scoped conversations.

  • Required: account_id
  • Actions: send (default), history, list, sample, list_samples

input

Debug any account input. Generic over input_type: the tool does not special-case messages, transactions, plugins, or other types. Conductor /input is a shell over this tool. Type chips on that screen come from the distinct types this tool returns, with a client-side preferred order. The server does not ship that list.

  • Required: account_id
  • command: list (default) — rows from the warehouse input table, joined to plugin for plugin_name / plugin_path, newest modified_at first. Optional exact input_type (string, comma-separated, or array), plugin_id, and q (substring on remote id, remote name, input id, plugin name, plugin path). Also returns input_types ({ input_type, inputs }) so a client can build filters. Includes sql. Default limit 200 (max 500).
  • command: files — recent files in that input’s store (ServerBaseWorker.listStore / FileWorker.list). Requires input_id. Newest modified_at first. Does not read file contents. Default limit 40 (max 200). file_count is every file in that directory, including ones past the recent page.
  • command: summary — record count and a row sample for one filename returned by files. Requires input_id and filename. .json and .json5 (optional .gz) use FileWorker.json and return format: "json" plus the parsed json value. A JSON array’s length is records; a JSON object has no record count. Other files use FileWorker.sample (default 8 rows, max 25). Their record count prefers that file’s records on metadata.json when present (records_source: "metadata"). Otherwise FileWorker.count reads the whole file (records_source: "scan"). Summary does not pass limit to count: that option is forwarded to the parser, and limit: 1 stops on the header and returns 0 records.
  • command: deleteFiles — delete every file directly in that input’s store directory. Requires input_id and the admin role. The directory comes from the input id; do not pass a path. One FileWorker.removeFiles call. Does not delete the warehouse input row, timeline rows, or files outside that folder. Call it only after files has been shown and the user has confirmed that folder. Do not call it in the same turn that lists the files.

Example list:

{ "command": "list", "account_id": "<account_id>", "input_type": "message" }

Example files:

{ "command": "files", "account_id": "<account_id>", "input_id": "<uuid>" }

Example summary:

{
  "command": "summary",
  "account_id": "<account_id>",
  "input_id": "<uuid>",
  "filename": "<filename from files>"
}

Example deleteFiles (only after the user confirms that store folder):

{ "command": "deleteFiles", "account_id": "<account_id>", "input_id": "<uuid>" }

file

Read a small slice of an account file via FileWorker.stream (local, s3://, r2://, gs://). Hard-locked to the scoped account_id.

  • Required: account_id, filename (or path)
  • filename may be relative (export/inventory.json5) or rooted (s3://engine9-accounts/<account_id>/…). Relative paths resolve under ENGINE9_STORED_INPUT_PATH/<account_id>. Paths outside the account, other accounts, or .. escapes are rejected.
  • Optional: start / end (inclusive byte offsets, same idea as GET /log). Default is the first 300KB. Window is capped at 300KB. Negative start tails from the end.
  • Returns { ok, filename, content, start, end, bytes, size, truncated }

Example:

{ "account_id": "test", "filename": "export/inventory.json5" }

apiKey

Create and manage engine9 API keys (e9key_ / e9publickey_) and their scopes. Keys are generic non-session auth for HTTP APIs (public signup/payment forms, inbound, Task API, and other scoped routes); the scope list is what a key can do. MCP itself stays on a user session and does not accept e9key_. Storage is @engine9/core SqlApiKeyStore (account api_key table, hash only). Prefer this over CLI or MCP task. Full contract: e9-api-key.

  • catalog (default when account_id omitted) — known scopes and form fields. No database.
  • list (default when account_id set) — keys for the account (no plaintext)
  • get — one key by id (no plaintext)
  • create — plaintext returned once (shown_once: true). Required: scopes
  • update — name / scopes / default_role_id / expires_at / active without rotating
  • revoke — deactivate
  • rotate — new plaintext once; old id revoked

Do not schedule createApiKey via task. Do not send e9key_ credentials to MCP.

Example catalog:

{ "command": "catalog" }

Example create:

{
  "command": "create",
  "account_id": "test",
  "name": "partner-tasks",
  "scopes": ["tasks:read", "tasks:schedule"]
}

On-demand tasks

MCP task (default action: "schedule") and REST POST /tasks/schedule use the same on-demand names: path + method (no flow_id).

For multi-step flows (identity rebuild, etc.), prefer flow_id / flow_path — see e9-tasks-api/deploy-flow.md. Do not hand-expand flow steps into on-demand schedules.

Built-in engine9 Workers

Every bootstrapped account has @engine9/plugins/e9workers. Pass that path plus a worker submodule. Do not call MCP account to look up a plugin id. Do not install a separate Echo plugin.

On-demand pathTypical method
@engine9/plugins/e9workers:EchoWorkerecho (smoke test)
@engine9/plugins/e9workers:SQLWorkerquery
@engine9/plugins/e9workers:SegmentWorkerlist, detail, build, buildSegmentPersonFile
@engine9/plugins/e9workers:InventoryWorkerinventory (cache lookup), buildInventorySummaryFile

Echo smoke test:

{
  "account_id": "test",
  "path": "@engine9/plugins/e9workers:EchoWorker",
  "method": "echo",
  "options": { "message": "hello from echo", "seconds": 1 }
}

Other installed plugins

For account-specific plugins (RENxt, …), discover path + method from MCP account plugins, then call task. Slash shorthand (renxt/people) is resolved against that list.

Fallback workflow: no native match → account → task

Rule: Installing a package is a native match. Use MCP plugin install (e9-plugin). Do not enter this fallback.

When the user's request does not map cleanly to a native tool:

  1. Ensure account scope — account_id must be known from this chat session (engine9.account_id after /e9a), an explicit user statement, or MCP account search when the user asked you to find matching accounts. If missing, ask the user or suggest /e9a <account_id> and stop — do not read leftover CLI files or compiled account catalogs for scope. If you only know org/prefix/plugin constraints and the user wants discovery, call account with command: "search" first. If search returns no accounts, stop — do not look up ids on disk.
  2. Pick the schedule mode:
    • Predefined / built-in flow (flow_id such as identity-rebuild, or account-published slug): call task with flow_id only (optional label). First task is paused by default — resume paused_task_run_id to start. See e9-tasks-api deploy-flow.md.
    • On-demand built-in (@engine9/plugins/e9workers:<Worker> such as Echo): call task with path + method. Skip plugin discovery.
    • On-demand account plugin: continue with steps 3–4.
  3. Call account immediately with { "account_id": "<account_id>" } (plugins command). If this fails (including getPluginMetadata), stop — do not call task. That metadata load must be fixed before scheduling a non-engine9 on-demand task can continue.
  4. Scan the returned plugins for a matching path/method combination:
    • Each plugin has a path (e.g. @frakture-com/channelbots/RENxtBot) and metadata.submodules with method lists.
    • Match user intent to a plugin path + submodule + method name.
    • Resolve alias/submodule shorthand (e.g. renxt/people) against metadata.alias and metadata.submodules keys.
  5. Call task with the resolved path, method, account_id, and any options. No flow_id.

Do not invent paths or methods for account plugins — only use combinations present in the account response. Do not mix flow_id with path/method.

Path resolution for task

Prefer these forms:

  • Built-in workers (no lookup): @engine9/plugins/e9workers:EchoWorker
  • Account plugin colon paths: @frakture-com/channelbots/RENxtBot:People
  • Slash alias for installed plugins (renxt/people) — resolved by the server; agents should resolve against cached engine9.plugins (from /e9a) first

Do not use remote-legacy dotted paths (channelbots.RENxtBot.People).

Example: scheduling a plugin method

User: "List custom fields on RENxt people for account <account_id>"

  1. No native tool for this specific plugin method → fallback path.
  2. Call account with { "account_id": "<account_id>" }.
  3. Find plugin with alias renxt, submodule People, method listCustomFields.
  4. Call task:
{
  "account_id": "<account_id>",
  "path": "@frakture-com/channelbots/RENxtBot:People",
  "method": "listCustomFields"
}
  1. To poll status, call task again with action: "listTasks" and flow_run_id / task_run_ids from the schedule response.

Account-scoped calls

All tools except ok, plugin_id, and input_id require authentication. Account-scoped tools (including file and apiKey except command: catalog) require an account_id the signed-in user can access. Do not guess account ids. Do not infer them from leftover local CLI state or compiled account catalogs — those are for the e9 / e9a bin scripts or the MCP host, not the agent. For MCP, ask for scope, require /e9a, or use MCP account search. If MCP does not return the account or parent, stop.

Parent / all scope — do not fan out DB access

When the user asks for all accounts, parent children, or other multi-account remote flow-run views (e.g. list errored remote runs via MCP task action: "list" → TaskWorker.listRemoteFlowRuns / remote-legacy POST /flow_runs/filter):

  • Do not call account plugins (or any account-DB worker) once per child to “check access”.
  • Do not use the first id in a parent/all list as a required DB-connected account_id before the remote list.
  • Drive the request with remote multi-account filters (parent_account_id, account_ids, etc.) and status filters. Use Prefect state_type values only (FAILED, RUNNING, COMPLETED, PAUSED, …). Legacy Mongo tokens (complete, error, in_progress) are rejected with 422. Account database connectivity is not a prerequisite for remote-legacy flow-run list reads.
  • The hard-stop on Cannot connect to the … database still applies to tools that truly need that account DB (sql, eql, search, timelinePerson, timelinePersonLegacy, single-account plugin schedule path resolution). It must not block multi-account remote flow-run listing.
  • Listing is one request. Counting or metrics for those runs is also one request (task action: "count" / "metrics" — same parent_account_id / account_ids). Archiving or bulk-retrying those runs is also one request: reuse the same parent_account_id / account_ids and send every flow_run_id together (bulk archive). Do not fan out one MCP call per child.

task action list — remote flow runs

MCP task with action: "list" calls TaskWorker.listRemoteFlowRuns (POST /flow_runs/filter on the remote-legacy Task API). Returns flow runs only — nested task_runs are not included. Each flow run includes account_id, parent_account_id (first id in that account's parent_ids, or null), and parent_ids.

MCP task with action: "count" calls POST /flow_runs/count (same filters as list). Returns { count }. Use with the current status filter for “N of total”.

MCP task with action: "metrics" calls POST /flow_runs/metrics. Returns { count, total, FAILED, RUNNING, COMPLETED } (extra types such as PAUSED only when matching). Rule: omit status so pills ignore the current state filter.

MCP task with action: "listTasks" (or "debug") calls TaskWorker.listRemoteTaskRuns (POST /task_runs/filter on the remote-legacy Task API) for a specific flow_run_id / task_run_ids. The result is { task_runs: [ … ], flow_run? } — the same shape as REST POST /task_runs/filter. Pass remote: false to list local runs. Each task_run / flow_run includes account_id, parent_account_id, and parent_ids. Each task_run includes log_link (/task_runs/{id}/log on the Task API). Listings omit checkpoints. Display state.name (aka state_name); color/group by state.type (state_type). Render commands from allowed_actions (pause, resume, retry, stop, update_options, reset_checkpoints). Do not read deprecated status (Mongo vocabulary).

MCP task with action: "get" calls GET /task_runs/:id (TaskWorker.getRemoteTaskRun). This is the single-task detail read: resolved_options, output, and checkpoints ([{ modified, options }] from worker modify_history). A task can have multiple checkpoints, oldest first. Checkpoints can exceed 1MB — request them only for one task. Workers write them; PATCH does not create a checkpoint. Retry does not clear them. allowed_actions includes reset_checkpoints when the job has checkpoints.

MCP task with action: "resetCheckpoints" (alias "reset_checkpoints") calls POST /task_runs/:id/reset_checkpoints. Reset only walks back from the most recent: start_index N keeps checkpoints[0 .. N) and drops later ones. Omitted / 0 clears all (RESET ALL). You cannot yank a checkpoint out of the middle while keeping later ones. Same as GraphQL job_reset_checkpoint. Not status-gated.

MCP task per-task-run controls (Firebase / MCP session — do not send e9key_ keys):

ActionTask APINotes
startPOST /task_runs/:id/retryRun now. Accepts force, start_after: "previous", start_after_task_run_id
retry + task_run_idPOST /task_runs/:id/retrySame as start; required for "Run after previous job"
pause / resumePOST /task_runs/:id/pause / /resumeTrue pause (not job kill). Offer only when allowed_actions contains the command
stopPOST /task_runs/:id/stopKill. set_state CANCELLED equivalent
updateOptionsPATCH /task_runs/:id { options }Pending/paused only; 409 when RUNNING/terminal
describePOST /tasks/describeMethod option metadata for path (marketplace first, then Frakture). method optional. Does not enqueue
getGET /task_runs/:idSingle-task details including checkpoints. Do not use listTasks for this
resetCheckpointsPOST /task_runs/:id/reset_checkpointsWalk back checkpoints. { "start_index": 0 } (default) is RESET ALL; N keeps the first N (oldest) and drops later ones. Cannot yank from the middle. Retry does not clear. Alias: reset_checkpoints
log / outputGET /task_runs/:id/log / /output{ log_link, log, truncated } and optional signed log_url from remote-legacy; prefer log_link for integrations
archive / bulk retryPOST /flow_runs/archive / /retryAll flow_run_ids in one call. After parent/all list, pass parent_account_id. user_id is not required. See bulk archive
countPOST /flow_runs/countSame filters as list. { count }. Ignores limit
metricsPOST /flow_runs/metricsFAILED / RUNNING / COMPLETED pills. Omit status so pills ignore the current state filter

Same account-scope auth as action: "list" (account header + bearer). Do not ask the user for a remote-legacy user_id.

Status filters take Prefect types only, e.g. { "status": ["FAILED"] }. 422 = invalid body, legacy status token, retry of a RUNNING run without force, or resetCheckpoints with a non-integer start_index. 409 = action not in allowed_actions (Prefect-styled message).

Example — walk back the most recent checkpoint (keep the first two):

{
  "action": "resetCheckpoints",
  "account_id": "<account_id>",
  "task_run_id": "<task_run_id>",
  "start_index": 2
}

Example — errored flow runs under a parent:

{
  "action": "list",
  "account_id": "<parent_account_id>",
  "parent_account_id": "<parent_account_id>",
  "status": ["FAILED"],
  "limit": 300
}

Status pills for the same parent (no status so FAILED / RUNNING / COMPLETED are independent of the list filter):

{
  "action": "metrics",
  "account_id": "<parent_account_id>",
  "parent_account_id": "<parent_account_id>"
}

Bulk archive / retry of flow runs

action: "archive" and bulk action: "retry" take every flow_run_id in one MCP call. Do not archive or retry one id at a time. Do not send user_id. Confirm with the user before a mass archive (count + how many accounts). Prefer terminal runs (COMPLETED, FAILED, CANCELLED, CRASHED) unless the user asked to archive in-progress work. The worker chunks at 500 ids (remote find/archive limit) — that is still one MCP call.

Single account:

{
  "action": "archive",
  "account_id": "<account_id>",
  "flow_run_ids": ["<flow_run_id>", "<flow_run_id>"]
}

Multiple accounts (parent / all — 100+ children)

action: "list" already returns errored runs across children in one request (parent_account_id / account_ids). Frakture POST /flow_runs/archive is the same: it looks up job lists by global ids. The only thing that used to force 100 remote hops was engine9 sending X-Account-Id for a single owner, which made Frakture skip every other account's ids.

Do not make one MCP task call per child. Do not add a JSON-RPC / generic batch endpoint. Pass the same multi-account flag as list so the remote hop omits X-Account-Id (server-token admin context, same as list). Then one Frakture POST archives every id, regardless of which child owns it.

  1. List once — { "action": "list", "account_id": "<parent_account_id>", "parent_account_id": "<parent_account_id>", "status": ["FAILED"], "limit": 300 } (page if needed). No per-child DB.
  2. Collect every flow run id. Confirm with the user.
  3. Archive once with those ids and the same parent_account_id (or account_ids):
{
  "action": "archive",
  "account_id": "<parent_account_id>",
  "parent_account_id": "<parent_account_id>",
  "flow_run_ids": ["<flow_run_id_1>", "<flow_run_id_2>"]
}

account_id is MCP auth (must be an account the user can access — typically the parent). parent_account_id / account_ids is what drops the remote account header. Omit that flag and mixed-owner ids are silently skipped.

REST: POST /flow_runs/archive with flow_run_ids plus parent_account_id or account_ids in the body. See e9-tasks-api endpoints.

Bulk retry with flow_run_ids uses the same flag. Per-task retry (task_run_id) stays single-run.

Quick validation flow

After Step 0 — Log in:

  1. Call user to confirm signed-in identity and account access.
  2. If account id is unknown, call account with command: "search" and the known filters (prefix/parent/plugin). If count is 0, stop — do not read compiled catalogs. Otherwise set scope via /e9a <account_id> or call account plugins to cache methods.
  3. Call search with a known email to validate account-scoped data access.
  4. For parent/all remote flow-run requests, skip step 2–3 per-child probes — use multi-account remote filters only.

Related documentation

TopicDocumentation
How MCP lists accounts (flat parent_ids)server/api/mcp/accounts.md
Install plugins on accountse9-plugin
Cursor setup and /e9 commandse9-cli
API-key creation and scope rulese9-api-key
Direct HTTP task and flow executione9-tasks-api
EQL query syntax and SQL table analysis (analyze)e9-eql
Plugin-installed reportse9-reports
Legacy report folders (explicit request only; do not code against them)e9-reports/legacy-folders.md
Plugin settings (define + catalog)create-engine9-plugin

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.