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
In this repository19 other files it gives its agents.
- .cursor/rules/no-client-names.mdcCursor rule
- .cursor/rules/skill-writing-standard.mdcCursor rule
- create-engine9-pluginSkill
- e9-api-keySkill
- e9-cliSkill
- e9-dev-tasksSkill
- e9-eqlSkill
- e9-exportSkill
- e9-global-messageSkill
- e9-inputSkill
- e9-inventorySkill
- e9-modelSkill
- e9-person-idSkill
- e9-person-remoteSkill
- e9-pluginSkill
- e9-reportsSkill
- e9-source-codeSkill
- e9-tasks-apiSkill
- e9-timelineSkill
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
- Very specific: line 32
Rule: Every /e9 or MCP request starts by logging in.
- Very specific: line 34
Call mcp_auth on the engine9 MCP server with {}.
- Very specific: line 36
Call ok, then user, to confirm signed in.
- Very specific: line 39
If user already succeeds this session, skip to step 4.
- Distinctive: line 50
After login, if MCP tools still fail, see e9-cli — troubleshooting.
- Distinctive: line 56
Rule: Stop the current workflow on an MCP error unless the response explicitly marks it safe to retry automatically.
- Very specific: line 93
When diagnosing timeline or model results, read sql first.
- Distinctive: line 97
When any of these is true, stop the current workflow immediately and report the error to the user.
- Distinctive: line 114
Do not retry automatically or call downstream tools as a workaround.
- Very specific: line 115
Do not guess plugin paths or methods when account failed — plugin discovery did not succeed.
- Very specific: line 116
Do not open accounts.d/, accounts.compiled.json5, account-config.json, account.<id>.json5, .e9_parameters, or any other local catalog to …
- Very specific: line 144
When interacting with an engine9 MCP server, discover capabilities and accounts exclusively from the MCP server.
- Distinctive: line 146
Rule: If MCP does not return an account, plugin path, method, or option, report that result and do not guess or search local catalogs.
- Distinctive: line 165
When an account or parent is not found, do NOT dig deeper into compiled account catalogs, etc.
- Distinctive: line 186
If a path, method, or option is not present in MCP responses, report that to the user — do not guess from local code.
- Very specific: line 192
Rule: Use a native MCP tool whenever it covers the request with equal or better fidelity.
- Distinctive: line 301
Use this when a screen needs signup, disabled date, and which months an account was active.
- Very specific: line 514
All commands include top-level sql: [{ id, sql, error, table?
- Very specific: line 554
Do not join person.id to person_id_int.
- Very specific: line 760
Read a small slice of an account file via FileWorker.stream (local, s3://, r2://, gs://).
- Very specific: line 785
Do not schedule createApiKey via task.
- Very specific: line 812
Every bootstrapped account has @engine9/plugins/e9workers.
- Distinctive: line 840
When the user's request does not map cleanly to a native tool:
- Very specific: line 854
Do not invent paths or methods for account plugins — only use combinations present in the account response.
- Very specific: line 864
Do not use remote-legacy dotted paths (channelbots.RENxtBot.People).
- Distinctive: line 870
No native tool for this specific plugin method → fallback path.
- Very specific: line 871
Call account with { "account_id": "<account_id>" }.
- Very specific: line 891
When the user asks for all accounts, parent children, or other multi-account remote flow-run views (e.g.
- Very specific: line 893
Do not call account plugins (or any account-DB worker) once per child to “check access”.
- Very specific: line 894
Do not use the first id in a parent/all list as a required DB-connected account_id before the remote list.
- Distinctive: line 1008
After Step 0 — Log in:
- Very specific: line 1010
Call user to confirm signed-in identity and account access.
- Very specific: line 1011
If account id is unknown, call account with command: "search" and the known filters (prefix/parent/plugin).
- Very specific: line 1012
Call search with a known email to validate account-scoped data access.
≈ “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.
Files
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
| Need | Use |
| Authenticate | mcp_auth with {}, then verify with ok and user |
| Install a plugin / list installable paths | plugin install / listAvailable — e9-plugin |
| Discover accounts or installed plugins | account |
| Child-account history for billing (signup, disabled, active months) | account search with history: true |
| Set an account's default warehouse | account command: setDefaultWarehouse with remote_plugin_id |
| Use a purpose-built operation | The matching native MCP tool |
| Run an on-demand worker method | task with path + method |
| Run a predefined flow | task with flow_id |
| Diagnose generated queries | The 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 folders | Do 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.
- Call
mcp_authon the engine9 MCP server with{}. - Cursor opens a sign-in prompt for the user — wait for them to complete it.
- Call
ok, thenuser, to confirm signed in. - 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 login | Why |
Shell commands (curl, grep, npm run mcp, …) | Not login; wastes time |
Reading mcp.json, STATUS.md, .env, local config | Not login |
e9 oauth token, local CLI, repo worker code | Wrong path for Cursor MCP |
Reporting "MCP unavailable" before mcp_auth | Always 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.
| Field | Meaning |
status | timeout, unauthorized, validation, or error |
requiresUserNotification | User should be told about this failure |
safeToRetryAutomatically | When 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 }
]
}| Field | Meaning |
id | Label for the statement |
sql | Statement text, or null if it was not generated |
error | null on success, "skipped" if not run, or the failure message |
table | Optional 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.
- Tool result has
isError: true - Response text matches a fatal pattern (even when only plain text is visible):
Cannot connect to the <account_id> databaseNot authorized for accountAuthentication requiredgetPluginMetadata(e.g.worker.getPluginMetadata is not a function)
- MCP
accountdid not return parseable{ ok: true, plugins: [...] } structuredContent.safeToRetryAutomaticallyisfalse- An account or parent is not found in MCP:
user.accountsis empty,accountsearchcountis0for 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
- Report the MCP error message verbatim to the user (or that MCP
user/accountsearch did not find the account or parent). - Do not retry automatically or call downstream tools as a workaround.
- Do not guess plugin paths or methods when
accountfailed — plugin discovery did not succeed. - 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. - 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. Fleetplugininstallskips that id and continues (e9-plugin). - For
getPluginMetadata: plugin metadata loading is broken on this server. Abort. That must be fixed before continuing — do not schedule via localTaskWorker, SQLplugin/bot_metadatalookups, guessedplugin_id/submodulepaths, or the REST Task API as a workaround.accountplugins andtaskschedule both depend on it.
Examples
Database unreachable (status: timeout):
Cannot connect to the <account_id> databaseUnauthorized account (status: unauthorized):
Not authorized for account <account_id>Plugin metadata missing (account plugins or task schedule):
worker.getPluginMetadata is not a functionIn 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
accountreflects 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.
| Need | MCP source |
| Who am I / which accounts can I use? | user (accounts flat map with parent_ids) |
| Find accounts by prefix, parent, name, type, tags, plugin | account command: "search" (one call; flat rows with same listing fields) |
| One account’s plugins / methods | account 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:
| Need | Source |
| Available MCP tools and parameters | MCP tool schemas (client tool descriptors for the connected server) |
| Account ids, names, parents | MCP user / MCP account search only |
| Installed plugins, submodules, methods | MCP account → plugins[].metadata |
| Installable package paths on this server | MCP plugin command: "listAvailable" |
| Install a package on an account | MCP plugin command: "install" — e9-plugin |
| Plugin settings (types, descriptions, current values), grouped by plugin | MCP plugin command: "settings" (PluginWorker.listSettings) |
| Schema / tables / indexes / raw SQL | MCP sql (command: query, describe, indexes, tables, info, histo, compile_eql) |
| Schedule or check async work | MCP 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 health | MCP timelinePerson (command: inspect) |
Account / person legacy timeline_v3* inspect | MCP timelinePersonLegacy (separate tool; not inspect + legacy) |
Compare current model_*_stats by source code | MCP 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 intent | Prefer |
| 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 plugin | account with command: "search" (one call — do not fan out; flat rows) |
| Child accounts with signup and disabled dates, including disabled accounts | account search with parents, history: true, and limit: 500. See Account history |
| List plugins / methods on one account | account with account_id (or command: "plugins") |
| Set an account's default warehouse | account 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 plugin | plugin with command: "settings" |
| Install a plugin on one account or a parent’s children | plugin install — e9-plugin. Do not use task |
| Search people by email, phone, name, or id | search |
| Search people in or out of a current model by source code | search with a searchOptions clause — e9-model — Person search |
| Search people in a legacy model and out of the current model | e9-model/legacy.md — only when the user explicitly asked for legacy |
| List available person-search form options for an account | searchOptions |
| Account / person current timeline + identity / model health | timelinePerson (command: inspect) |
Account / person legacy timeline_v3* inspect | timelinePersonLegacy |
Compare current model_*_stats by source code | timelinePerson 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 builds | segment |
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 folders | Do not use unless the user explicitly asked. legacyReportFolder is not a report to code against. Legacy report folders |
| Read or schedule account warehouse inventory | inventory (get first; build only if not ready) |
Debug an input: list the input table, recent store files, file record count and sample | input (list, files, summary). Caller supplies input_type; the tool does not catalog types |
| Create accounts / manage domains or domain secrets | e9-account Worker (cloud-services/e9-account) — not MCP |
| Run a SQL/EQL query | eql / sql (command: "query" or omit when sql is set) |
| Analyze / summarize a table | analyze |
| Describe tables, indexes, list tables, histo | sql with command: "describe" / "indexes" / "tables" / "histo" |
| Compute plugin or input UUIDs | plugin_id, input_id |
| Chat / conversation history | chat |
| Read a small slice of an account file (S3 / local) | file |
| List inputs, recent store files, or a file sample | input (list / files / summary). input_type is an exact filter the caller supplies |
| Create / list / update / rotate / revoke API keys and scopes | apiKey — see e9-api-key. Never via task |
| Run an on-demand plugin method | task 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 lists | task 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/checkpoints | task 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_idis the JSON API echo ofremote_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 includespath, DB fields, andmetadata(alias, submodules, methods, auth_fields, …).default_warehouse_bot_idis the catalog default warehouse (plugin.remote_plugin_id, or null). It is read-only on this command; change it withsetDefaultWarehouse - 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, orplugins - Optional:
recursive(withparents),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 asuser.accounts(name,type,parent_ids,disabled,tags) plusaccount_id.parents/recursiveonly filter which rows appear; they do not nest children. include_pluginsattaches lite plugin rows (id/name/path/table_prefix) per account.include_plugin_metadataadds one marketplace metadata map keyed by plugin path — do not fan outcommand: pluginsper account to build a method catalog.pluginsfilter matches installed pluginpath/name/table_prefixsubstrings (e.g.["acoustic"]). Applyprefix/parentsfirst so DB probes stay bounded.- Per-account DB failures go into
warnings(do not fail the whole search). count: 0is 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:
| Field | Meaning |
disabled | Current Frakture flag when history_status is ok. Otherwise the catalog flag |
date_created | ISO-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_disabled | ISO-8601. null when the account has never been disabled |
last_enabled | ISO-8601. null when the account has never been enabled |
enable_disable_history | Oldest 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_status | ok, 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.
| Situation | Signup | Disabled date | Active in a month |
Earliest history event has disabled: false (including the created: true event) | That event’s date | last_disabled when disabled is true, otherwise blank | From that enable until the next disable. A later enable starts again. An open interval runs through now |
Earliest event has disabled: true | Before that date (already enabled; creation was not returned) | That disable, and last_disabled if still disabled | From the start of the chart through the month before the disable, then any later enable/disable pairs |
No history events, last_enabled set, account enabled | last_enabled | blank | From last_enabled through now |
No history events, last_disabled set, account disabled | Before last_disabled | last_disabled | Through 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 enabled | Unknown | blank | Current month only |
history_status is missing or error | Unavailable | Catalog disabled only | Leave 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_idworks) - 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 Schemaform,settings[](type,description,values,default, currentvalue). Optionalpath/plugin_id. Hidden settings omitted unlessinclude_hidden: true. Compile failures go inerrors(call still succeeds) - setSetting — update one warehouse value. Required:
plugin_id,name. Validatesvalues/ 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 fromsearchOptions, 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 }whereresultis thePersonWorker.searchpayload
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.
| Intent | Clause |
| In the model's person credit for a code | { path: "@engine9/plugins/models/<model>:search:personSourceCode", options: { sourceCode } } |
| Out of that credit | Same clause with exclude: true |
| In person credit vs has a credited transaction | personSourceCode 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 Schemasearches— handlers from installed plugins:path,title, canonicalform,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
pathordefinitionwithoptions/start/end/limit/offset. Returns componentdataplus top-levelsql. 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: truealso 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) withvisibilitypublicorprivate. Admin role.target_account_id, when sent, must equalaccount_id - command: setVisibility — set
publicorprivateon a storedid. 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_codesfor an account-wide load (entry-type min/max/count, identity table counts, transaction min/max,model_*_person/model_*_transactioncounts — not*_stats). Person-scoped (person_ids/emails) returns timeline detail +model_*_persononly and skips those account audit COUNTs.person_idsis a number, string, or array of either (warehouseperson.idis an integer — do not stringify). Optionalsource_codes(comma-delimited;%is LIKE) filters those queries. Missing tables are skipped. Do not joinperson.idtoperson_id_int. - command: compareSourceCodes — all current
model_*_statsby source code (person_count,revenue,transactions). Omitsource_codesto union each model's top 10 by people and by revenue. Optionalmodelssubset. Returnssqlfor top-N selection and per-model stats. Pivot stems andlegacy: trueare 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(currentperson.id— email lookup only),source_codes,row_limit,people_limit - Account-wide:
timeline_v3min/max/count,transaction_model_source_code.person_model_source_codetotals are skipped (no account-wide COUNT) - With email / person_ids / source_codes:
person_model_source_codetotals by model; with email also person-leveltimeline_v3_summary/person_model_source_code. Type column isentry_type_label - Do not join
person.idtoperson_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, orbuild) - list — summary rows from
segmentjoined toplugin(plugin_name,plugin_path). Structured filters only:plugin_id,plugin_path,segment_id/segment_ids,remote_segment_ids,build_type,submodule,fields. Optionalfields: '*'for all columns. Returnssql. - detail — full
segmentrow(s) plus plugin_name / plugin_path. Requiressegment_idorsegment_ids. Returnssql. - build — enqueue a segment person-file build. Requires
segment_idordefinition_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: trueplus path / size / modified_at. Does not parse the file. If not:ready: false(do not retry get as a workaround — offerbuild). Full report:GET /data/inventory/report(gzip bytes,204if missing) or MCPfilewithfilename: cache/inventory.json.gz. - command: build — schedule
InventoryWorker.buildInventorySummaryFilevia 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):
- Auth with Delegate (
GET /auth/login→/auth/delegate) POST /v1/accounts/create— optional{ slug, name, backend }; returns endpoints +public_api_key(not shared secret)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 withtable,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).
| command | Purpose |
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 |
describe | Column schema for table |
indexes | Indexes for table |
tables (default when sql omitted) | List/filter table names (filter, includeTemp, …) |
info | Driver/dialect info |
histo | Date histogram on a datetime column (index not required; default prefers indexed) |
compile_eql | EQL 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 toSQLWorker.tables({ filter })) - Optional:
max_tables(default 3, max 10),target_buckets(default 10; date histogram only) - Workflow:
tables({ filter })— regex first; if no matches, language-token fallback onfilteranalyzeon 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 field | Meaning |
name, type | Column name and inferred type (string, int, bigint, double, decimal, date, datetime, uuid) |
min, max | Sample range. When a histogram runs, every datetime column is replaced with full-table SQL min/max |
empty | Null or missing values in the sample |
distinct | Distinct values seen in the sample |
sample | Up to 32 most frequent sample values (stringified) |
min_length, max_length | Present on string columns |
buckets | On datetime columns when a histogram runs: { range, start, end, records, min, max } |
bucket_column | true on the histogram column (ts, then created_at, then modified_at, else the first indexed datetime leading column) |
bucket_unit | day, 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
inputtable, joined topluginforplugin_name/plugin_path, newestmodified_atfirst. Optional exactinput_type(string, comma-separated, or array),plugin_id, andq(substring on remote id, remote name, input id, plugin name, plugin path). Also returnsinput_types({ input_type, inputs }) so a client can build filters. Includessql. Default limit 200 (max 500). - command: files — recent files in that input’s store (
ServerBaseWorker.listStore/FileWorker.list). Requiresinput_id. Newestmodified_atfirst. Does not read file contents. Default limit 40 (max 200).file_countis every file in that directory, including ones past the recent page. - command: summary — record count and a row sample for one
filenamereturned byfiles. Requiresinput_idandfilename..jsonand.json5(optional.gz) useFileWorker.jsonand returnformat: "json"plus the parsedjsonvalue. A JSON array’s length isrecords; a JSON object has no record count. Other files useFileWorker.sample(default 8 rows, max 25). Their record count prefers that file’srecordsonmetadata.jsonwhen present (records_source: "metadata"). OtherwiseFileWorker.countreads the whole file (records_source: "scan"). Summary does not passlimittocount: that option is forwarded to the parser, andlimit: 1stops on the header and returns 0 records. - command: deleteFiles — delete every file directly in that input’s store directory. Requires
input_idand the admin role. The directory comes from the input id; do not pass a path. OneFileWorker.removeFilescall. Does not delete the warehouseinputrow, timeline rows, or files outside that folder. Call it only afterfileshas 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(orpath) filenamemay be relative (export/inventory.json5) or rooted (s3://engine9-accounts/<account_id>/…). Relative paths resolve underENGINE9_STORED_INPUT_PATH/<account_id>. Paths outside the account, other accounts, or..escapes are rejected.- Optional:
start/end(inclusive byte offsets, same idea asGET /log). Default is the first 300KB. Window is capped at 300KB. Negativestarttails 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_idomitted) — known scopes and form fields. No database. - list (default when
account_idset) — 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/activewithout 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 path | Typical method |
@engine9/plugins/e9workers:EchoWorker | echo (smoke test) |
@engine9/plugins/e9workers:SQLWorker | query |
@engine9/plugins/e9workers:SegmentWorker | list, detail, build, buildSegmentPersonFile |
@engine9/plugins/e9workers:InventoryWorker | inventory (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:
- Ensure account scope —
account_idmust be known from this chat session (engine9.account_idafter/e9a), an explicit user statement, or MCPaccountsearch 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, callaccountwithcommand: "search"first. If search returns no accounts, stop — do not look up ids on disk. - Pick the schedule mode:
- Predefined / built-in flow (
flow_idsuch asidentity-rebuild, or account-published slug): calltaskwithflow_idonly (optionallabel). First task is paused by default — resumepaused_task_run_idto start. See e9-tasks-api deploy-flow.md. - On-demand built-in (
@engine9/plugins/e9workers:<Worker>such as Echo): calltaskwithpath+method. Skip plugin discovery. - On-demand account plugin: continue with steps 3–4.
- Predefined / built-in flow (
- Call
accountimmediately with{ "account_id": "<account_id>" }(plugins command). If this fails (includinggetPluginMetadata), stop — do not calltask. That metadata load must be fixed before scheduling a non-engine9on-demand task can continue. - Scan the returned plugins for a matching path/method combination:
- Each plugin has a
path(e.g.@frakture-com/channelbots/RENxtBot) andmetadata.submoduleswith method lists. - Match user intent to a plugin path + submodule + method name.
- Resolve alias/submodule shorthand (e.g.
renxt/people) againstmetadata.aliasandmetadata.submoduleskeys.
- Each plugin has a
- Call
taskwith the resolvedpath,method,account_id, and anyoptions. Noflow_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 cachedengine9.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>"
- No native tool for this specific plugin method → fallback path.
- Call
accountwith{ "account_id": "<account_id>" }. - Find plugin with alias
renxt, submodulePeople, methodlistCustomFields. - Call
task:
{
"account_id": "<account_id>",
"path": "@frakture-com/channelbots/RENxtBot:People",
"method": "listCustomFields"
}- To poll status, call
taskagain withaction: "listTasks"andflow_run_id/task_run_idsfrom 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
accountplugins (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_idbefore the remote list. - Drive the request with remote multi-account filters (
parent_account_id,account_ids, etc.) and status filters. Use Prefectstate_typevalues 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 … databasestill 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 (
taskaction: "count"/"metrics"— sameparent_account_id/account_ids). Archiving or bulk-retrying those runs is also one request: reuse the sameparent_account_id/account_idsand send everyflow_run_idtogether (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):
| Action | Task API | Notes |
start | POST /task_runs/:id/retry | Run now. Accepts force, start_after: "previous", start_after_task_run_id |
retry + task_run_id | POST /task_runs/:id/retry | Same as start; required for "Run after previous job" |
pause / resume | POST /task_runs/:id/pause / /resume | True pause (not job kill). Offer only when allowed_actions contains the command |
stop | POST /task_runs/:id/stop | Kill. set_state CANCELLED equivalent |
updateOptions | PATCH /task_runs/:id { options } | Pending/paused only; 409 when RUNNING/terminal |
describe | POST /tasks/describe | Method option metadata for path (marketplace first, then Frakture). method optional. Does not enqueue |
get | GET /task_runs/:id | Single-task details including checkpoints. Do not use listTasks for this |
resetCheckpoints | POST /task_runs/:id/reset_checkpoints | Walk 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 / output | GET /task_runs/:id/log / /output | { log_link, log, truncated } and optional signed log_url from remote-legacy; prefer log_link for integrations |
archive / bulk retry | POST /flow_runs/archive / /retry | All flow_run_ids in one call. After parent/all list, pass parent_account_id. user_id is not required. See bulk archive |
count | POST /flow_runs/count | Same filters as list. { count }. Ignores limit |
metrics | POST /flow_runs/metrics | FAILED / 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.
- 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. - Collect every flow run
id. Confirm with the user. - Archive once with those ids and the same
parent_account_id(oraccount_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:
- Call
userto confirm signed-in identity and account access. - If account id is unknown, call
accountwithcommand: "search"and the known filters (prefix/parent/plugin). Ifcountis0, stop — do not read compiled catalogs. Otherwise set scope via/e9a <account_id>or callaccountplugins to cache methods. - Call
searchwith a known email to validate account-scoped data access. - For parent/all remote flow-run requests, skip step 2–3 per-child probes — use multi-account remote filters only.
Related documentation
| Topic | Documentation |
How MCP lists accounts (flat parent_ids) | server/api/mcp/accounts.md |
| Install plugins on accounts | e9-plugin |
Cursor setup and /e9 commands | e9-cli |
| API-key creation and scope rules | e9-api-key |
| Direct HTTP task and flow execution | e9-tasks-api |
EQL query syntax and SQL table analysis (analyze) | e9-eql |
| Plugin-installed reports | e9-reports |
| Legacy report folders (explicit request only; do not code against them) | e9-reports/legacy-folders.md |
| Plugin settings (define + catalog) | create-engine9-plugin |
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
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.

