IRIS Development Tools MCP Server
v1.3.0IRIS Development Tools MCP Server
All servers use the same environment variables: Optionally, set IRIS_PROFILES (a JSON map of named IRIS instances) and IRIS_GOVERNANCE (a JSON tool-action policy) to target several instances from one server and restrict which actions are allowed. Every tool accepts an optional server parameter (a profile name from IRIS_PROFILES) that selects which instance the call targets; omit it to use the default profile. It composes with the existing per-call namespace override.
Summary extracted from the README.
@iris-mcp/dev
IRIS Development Tools MCP Server -- ObjectScript document CRUD, compilation, SQL execution, analysis, and performance advisories, globals management, code execution, unit testing with line coverage (a verdict against a target, and a Cobertura file for CI), package browsing, bulk export, lines-of-code analysis, and cross-profile environment diff & promotion via the Model Context Protocol.
Part of the IRIS MCP Server Suite.
Installation
npm install -g @iris-mcp/dev
Or run directly without installing:
npx -y @iris-mcp/dev@1
Configuration
All servers use the same environment variables:
| Variable | Default | Description |
|---|---|---|
IRIS_HOST |
localhost |
IRIS hostname or IP |
IRIS_PORT |
52773 |
IRIS web server port |
IRIS_USERNAME |
(required) | IRIS username. There is no default: a server that starts without it fails, naming the variable. |
IRIS_PASSWORD |
(required) | IRIS password |
IRIS_NAMESPACE |
USER |
Default IRIS namespace |
IRIS_HTTPS |
false |
Use HTTPS instead of HTTP |
IRIS_DATA_POLICY |
(unset — redact) |
Optional. block, redact or allow: the PHI data policy (per profile: an IRIS_PROFILES entry's dataPolicy or the governance file's dataPolicy section). block turns off the raw-read and code-execution tools of this server: iris_sql_query, iris_sql_execute, iris_global_get, iris_global_list, iris_execute_command, iris_execute_classmethod, iris_execute_tests and iris_test_coverage (the last is a write that is off by default anyway), and from 1.3.0 the stats, running and advise actions of iris_sql_analyze, which return other sessions' statement text or bound literals (explain and indexUsage stay on; sanctioned change S-45.7-block-sql-analyze). An explicit governance key re-enables one ({"profiles":{"prod":{"iris_sql_query":true}}}); IRIS_TOOLS_ENABLE only shows a tool and does not. Under redact (the default) nothing changes except one startup [WARN] line naming the enabled ones, because redact covers message bodies only; under block the line names only the ones an explicit key re-enabled, and the setting that did. Sanctioned change S-45.4-block-raw-tools. See PHI data policy in the suite README. |
IRIS_ACCEPT_LANGUAGE |
en-US,en;q=0.9 |
Optional. Accept-Language header sent on every request, pinning %Status error text to a predictable language instead of whatever locale an unspecified header resolves to. IRIS also chooses the message language per request, by matching this header against the languages the instance has, so a localized prefix can still appear when the header names one — existing prefix-stripping is unaffected. Details: suite README. |
Multiple servers & the server parameter
Optionally, set IRIS_PROFILES (a JSON map of named IRIS instances) and IRIS_GOVERNANCE (a JSON tool-action policy) to target several instances from one server and restrict which actions are allowed. Every tool accepts an optional server parameter (a profile name from IRIS_PROFILES) that selects which instance the call targets; omit it to use the default profile. It composes with the existing per-call namespace override. Both variables are optional and additive — omit them and this server behaves exactly as a single-instance, fully-enabled install. Full model, escaping, and worked examples: Multiple Servers & Governance.
Optionally, set IRIS_GOVERNANCE_FILE to the path of a JSON file of the same shape as IRIS_GOVERNANCE to load policy from a file shared across several MCP clients instead of inline JSON. Optional and additive — unset (the default) means inert: no file is ever read and behavior is byte-for-byte unchanged. An IRIS_GOVERNANCE env value always wins over the file. Details: Governance file.
Read-only mode (IRIS_GOVERNANCE_PRESET)
Set IRIS_GOVERNANCE_PRESET=read-only to block every write-classified action on this server with one environment variable — no IRIS_GOVERNANCE JSON needed. IRIS_GOVERNANCE_PRESET is framework configuration, not a tool — it applies identically across all five servers in the suite (@iris-mcp/dev included), not something this package registers or exposes. An explicit IRIS_GOVERNANCE override still wins over the preset. Omit (or set "full") for today's behavior (opt-in, default off). The preset also turns the automatic install off (IRIS_AUTO_INSTALL, default on; a profile's autoInstall wins), so a read-only server installs nothing on IRIS, and a missing or older IRIS side makes the custom-REST tools answer IRIS_SIDE_NOT_INSTALLED while the Atelier-only tools keep working. Details: Read-only mode.
Tool Visibility (IRIS_TOOLS_PRESET)
Set IRIS_TOOLS_PRESET=core to trim this server's tools/list to a 15-tool runtime roster (14 package tools + iris_server_profiles; about 13 is a guideline, not a hard limit) — the authoring loop (get/edit/put/list/compile/load), the execution & debug loop (command/classmethod/tests, global get/set/kill), and the SQL tools iris_sql_execute and iris_sql_query. iris_doc_get and iris_doc_edit are a pair and stay co-visible in every preset, and so are iris_test_coverage and iris_test_status (both outside core). IRIS_TOOLS_PRESET=developer keeps all 33 runtime tools (32 + iris_server_profiles) visible — every tool on this server is already dev-relevant, so developer behaves like full here. Omit (or set "full") for today's behavior — every tool visible, byte-for-byte. IRIS_TOOLS_DISABLE/IRIS_TOOLS_ENABLE hide/force-show individual tools independent of the preset. This is orthogonal to IRIS_GOVERNANCE_PRESET above (visibility = does the agent know a tool exists; governance = is an already-visible call allowed). Full model, exact per-tool roster, and the payload-size measurements: Tool Visibility Presets.
Prompt-pack limitation. Two of this server's prompts call tools
corehides:diagnose-slow-querycallsiris_sql_analyze(hidden undercore), andpromote-environment-changecallsiris_env_diff/iris_env_promote(both hidden together undercore— they are always co-visible). Both prompts work unchanged underfullordeveloper. Running undercore, either switch tofull/developeror setIRIS_TOOLS_ENABLEto re-show the specific tool(s) the prompt needs.
Audit Logging (IRIS_AUDIT_LOG)
For regulated deployments, set IRIS_AUDIT_LOG=/path/to/audit.jsonl to record every MCP tool call this server handles — success, error, or governance denial — as one secrets-free JSON line (session, sequence, tool, action, outcome, redacted parameter keys). It is off by default (unset ⇒ a mechanical no-op, zero filesystem writes) and framework-wide — the same interceptor covers every tool on this server. IRIS_AUDIT_LOG_MAX_MB (default 50) sets the single-generation rotation size; IRIS_AUDIT_LOG_PARAMS=true additionally records (redacted) parameter values. Because it is server-side configuration — not a governed tool action — an AI client cannot disable its own audit trail; only an operator with server-environment access can. Full record shape, redaction rules, and how it differs from IRIS's own iris_audit_* security-audit tools: Compliance & Auditability.
What the safety settings protect: the safety settings (governance, the presets, the confirmation dialogs, the audit log, the data policy, the SQL safety settings and the document write guards) guard the agent that uses this server, not the IRIS account, whose privileges are the boundary. See What the safety settings protect.
Server Manager connections (IRIS_SERVER_MANAGER)
Set IRIS_SERVER_MANAGER=auto to import IRIS connection definitions straight from the InterSystems Server Manager VS Code extension's intersystems.servers settings — one curated roster instead of re-typing host/port/username into every MCP client's config. IRIS_SERVER_MANAGER is framework configuration, not a tool — it applies identically across all five servers in the suite. Omit (or set "off", the default) for today's behavior: no settings file is ever read. A password-less imported definition is completed via an OS-keychain / IRIS_CREDENTIAL_HELPER credential chain (see the iris-mcp-credentials CLI — Server Manager passwords themselves are never readable outside VS Code, by design); iris_server_profiles reports where each profile's connection fields came from via source ("env"/"server-manager") and sourceFile. The companion variables are all optional, each with its own default: IRIS_SM_SERVERS (unset — import all), IRIS_SM_SETTINGS_PATHS (unset — normal discovery), IRIS_SM_WORKSPACE (unset — the process CWD) and IRIS_CREDENTIAL_HELPER (unset). Full model, discovery precedence, and the SecretStorage boundary explained plainly: Server Manager connections.
MCP Client Configuration
Claude Code (.mcp.json)
{
"mcpServers": {
"iris-dev-mcp": {
"command": "npx",
"args": ["-y", "@iris-mcp/dev@1"],
"env": {
"IRIS_HOST": "localhost",
"IRIS_PORT": "52773",
"IRIS_USERNAME": "_SYSTEM",
"IRIS_PASSWORD": "SYS",
"IRIS_NAMESPACE": "USER"
}
}
}
}
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"iris-dev-mcp": {
"command": "npx",
"args": ["-y", "@iris-mcp/dev@1"],
"env": {
"IRIS_HOST": "localhost",
"IRIS_PORT": "52773",
"IRIS_USERNAME": "_SYSTEM",
"IRIS_PASSWORD": "SYS",
"IRIS_NAMESPACE": "USER"
}
}
}
}
Cursor
Add to your Cursor MCP settings:
{
"iris-dev-mcp": {
"command": "npx",
"args": ["-y", "@iris-mcp/dev@1"],
"env": {
"IRIS_HOST": "localhost",
"IRIS_PORT": "52773",
"IRIS_USERNAME": "_SYSTEM",
"IRIS_PASSWORD": "SYS",
"IRIS_NAMESPACE": "USER"
}
}
}
Note: Replace
"SYS"with your actual IRIS password. Avoid committing real credentials to version control.
Tool Reference
Framework Tools
Provided by the shared framework and available on every suite server (Epic 19).
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_server_profiles |
Call this first. Reports the configured server-profile roster (non-secret connection metadata — password is never included) and the effective governance policy (which actions are enabled/disabled). |
profile?, allProfiles? |
readOnly, idempotent |
iris_server_profiles is a read tool, enabled by default. It reports in-memory config and does not connect to IRIS. Use it to choose the right server profile and avoid governance-disabled actions before invoking other tools.
Document Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_doc_get |
Retrieve a document by name (UDL or XML format), or a numbered line range of a UDL text document | name, namespace?, format?, metadataOnly?, startLine?, endLine? |
readOnly, idempotent |
iris_doc_put |
Debug/scratch — write a document directly to IRIS without creating a file on disk (use iris_doc_load for production code). An existing document is saved only if it has not changed since the tool read its current version; a put to an existing class that drops one of its Storage definitions is refused |
name, content, namespace?, ignoreConflict? (default: false; skips the version check), allowStorageRegeneration? (default: false; lets a put that drops Storage definitions through) |
destructive, idempotent |
iris_doc_edit |
Surgical line edits of an existing class, routine or include file: insert, delete or replace lines addressed by the numbers of a ranged iris_doc_get, each guarded by its expected text; all edits apply or none, in one version-checked save, and the answer (a unified diff, an excerpt per edit, totalLines, ts) comes from a re-read. Does not compile. apply is a write that is enabled by default (Project Lead decision S-3: every edit is guarded by expected, the save is version-checked and never retried, and a class edit that would drop a Storage definition is refused); disable it with {"global": {"iris_doc_edit:apply": false}}, or by disabling iris_doc_put. regenerateStorage (the Storage-guard override) is disabled by default |
action (apply | regenerateStorage), name, edits (each: op, afterLine?, startLine?, endLine?, text?, expected), namespace? |
destructive |
iris_doc_delete |
Delete one or more documents | name (string or array), namespace? |
destructive, idempotent |
iris_doc_list |
List documents with optional filters | category?, type?, filter?, generated?, namespace?, modifiedSince? (refused: IRIS cannot filter documents by modification time, so a call with a non-empty value is refused and lists nothing; compare the ts of the listed documents instead), cursor? |
readOnly, idempotent |
iris_doc_load |
Bulk upload files from disk into IRIS; with compile: true the compile is checked as iris_doc_compile's is |
path (glob), baseDir?, compile?, flags?, namespace?, ignoreConflict? (default: true: each file overwrites its server copy without a version check; false: a file whose document already exists is saved under a version check, and fails with DOCUMENT_CONFLICT if the document changes on the server while it is being saved, while the other files continue), allowStorageRegeneration? (default: false: a class file whose content drops one of the Storage definitions the existing class has is refused as a failures entry with STORAGE_DROPPED, nothing is stored for that file and the other files continue; true: the file is uploaded, IRIS generates new storage at the next compile, and the result's storageDrops names the dropped definitions) |
destructive, idempotent |
iris_doc_export |
Bulk-download documents to a local directory (inverse of iris_doc_load) |
destinationDir, prefix?, category?, type?, generated?, system?, modifiedSince? (refused, as for iris_doc_list), namespace?, includeManifest?, ignoreErrors?, useShortPaths?, overwrite?, continueDownloadOnTimeout? |
destructive, idempotent |
Package Browsing Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_package_list |
Roll up namespace documents into packages at a chosen depth | depth?, prefix?, category?, type?, generated?, system?, modifiedSince? (refused, as for iris_doc_list), namespace? |
readOnly, idempotent |
Compilation Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_doc_compile |
Compile one or more documents; a synchronous compile that IRIS answered with no error listed is checked (classes and .mac routines) against IRIS's own compile state, so a document that did not compile is named (see "The compile check" under the iris_doc_compile example below) |
doc (string or array), flags?, async?, namespace? |
idempotent |
Code Intelligence Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_doc_index |
Get class structure (methods, properties, superclasses) | name, namespace? |
readOnly, idempotent |
iris_doc_search |
Search across code with regex/wildcard options | query, regex?, word?, case?, wild?, files?, sys?, gen?, max?, namespace? |
readOnly, idempotent |
iris_macro_info |
Look up macro definitions and source locations | name, document?, includes?, namespace? |
readOnly, idempotent |
iris_routine_intermediate |
Fetch the compiled-intermediate routine (.1.int) for a class by its bare name — macro-expanded form IRIS executes at runtime | name, namespace?, format? |
readOnly, idempotent |
Format and Export Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_doc_convert |
Convert document between UDL and XML | name, targetFormat, namespace? |
readOnly, idempotent |
iris_doc_xml_export |
Export, import, or list documents in XML format. Import loads definitions WITHOUT compiling by default (the response says so); pass compile: true to compile in the same call. An import that would drop a Storage definition an existing class has (its XML lacks it) is refused with STORAGE_DROPPED before anything is loaded |
action, docs?, content?, compile?, flags?, namespace?, allowStorageRegeneration? (default: false: the import is refused if the XML of an existing class lacks one of the Storage definitions the class has; true: the import goes ahead, IRIS generates new storage at the next compile, and the result's storageDrops names the dropped definitions; import only) |
destructive (import), not idempotent |
SQL Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_sql_execute |
Execute a SQL statement with parameterized values; optionally read-only (readOnly, default false), capped by rows affected (maxRowsAffected, default no cap; 0 is a dry count), or count-only (countOnly, default false) |
query, parameters?, maxRows?, readOnly?, maxRowsAffected?, countOnly?, namespace? |
destructive |
iris_sql_query |
Run a SQL query (SELECT only) with parameterized values; read, enabled by default, available under the read-only preset | query, parameters?, maxRows?, countOnly?, namespace? |
readOnly, idempotent |
iris_sql_analyze |
Analyze SQL: show query plan (explain), parse maps/indexes from the plan (indexUsage), cached-statement stats (stats), currently-running statements (running), or get SQL Performance Advisor findings (advise) |
action, query?, filter?, maxRows?, workload?, topN?, namespace? |
readOnly, idempotent |
Governance defaults: all five
iris_sql_analyzeactions (explain/stats/indexUsage/running/advise) are classifiedreadand are therefore enabled by default — none is gated behindIRIS_GOVERNANCE. (Areadclassification is still required for every new tool key, but reads resolve enabled under the default seed.) UnderIRIS_DATA_POLICY=block,stats,runningandadviseare seeded disabled (from1.3.0), so thediagnose-slow-queryprompt loses itsstatsstep there; an explicit governance key re-enables one.
advise— SQL Performance Advisor (Epic 28): givenquery(orworkload: trueto advise the top-topNrecent statements instead, mutually exclusive withquery), returns evidence-cited findings —full-scan,missing-index(with a suggestedCREATE INDEXDDL),stale-stats,unused-index,plan-anomaly— each carrying a plan excerpt and a confidence level. Strictly advisory: recommendations are heuristic; verify withexplainbefore applying any change —advisenever applies anything itself (no write/applyIndexaction ships in v1).topN(default 5, max 20) bounds real analysis work inworkloadmode, not just output size — each statement analyzed is a full endpoint round-trip (EXPLAIN + dictionary reads), so a largertopNis proportionally more work. If the recent-statement workload source is unavailable on your IRIS edition/version,workloadmode returns a clear capability message rather than a raw SQL error.Governance defaults (SQL):
iris_sql_executekeeps its pre-governance classification (a write that is enabled by default, so it is blocked by the read-only preset).iris_sql_query(Story 38.5) is classifiedreadand is therefore enabled by default, and it stays enabled under the read-only preset. Its parent key isiris_sql_execute: when an operator explicitly disablesiris_sql_execute,iris_sql_queryis disabled too (aGOVERNANCE_DISABLEDrefusal withinheritedFrom: "iris_sql_execute"), unlessiris_sql_queryis set explicitly, e.g.{"global":{"iris_sql_execute":false,"iris_sql_query":true}}. See Parent keys.SQL write safety (optional, opt-in — Story 38.5):
iris_sql_executetakesreadOnly(defaultfalse: only queries run; any other statement is refused withSQL_READ_ONLYbefore it runs),maxRowsAffected(default: no cap;0is a dry count: an INSERT, UPDATE or DELETE that changes more rows is rolled back and refused withSQL_ROWS_AFFECTED_CAP; under a cap only SELECT, INSERT, UPDATE and DELETE run, and an INSERT, UPDATE or DELETE whose text contains the%NOJOURNtoken (a comment or a string counts) is refused before it runs, because it turns journaling off and the rollback could not undo it; the count is the statement's own row count, so rows that triggers, cascades or functions change are not counted and a SELECT is not bounded by it) andcountOnly(defaultfalse: returnstotalCountand no rows). An operator may setIRIS_SQL_READ_ONLY=true(every call read-only; unset by default) andIRIS_SQL_MAX_ROWS_AFFECTED(a non-negative integer ceiling; unset by default); a call can only tighten them, and the result carriesreadOnlyForcedormaxRowsAffectedCappedwhen one applied.IRIS_SQL_READ_ONLYacceptstrueorfalse(case-insensitive) andIRIS_SQL_MAX_ROWS_AFFECTEDa non-negative integer (0is valid); an empty value counts as unset, and any other value fails startup, naming the variable. Both variables are global: every profile inherits them, and there is no per-profile key. An INSERT, UPDATE or DELETE result carriesrowsAffected(-1forTRUNCATE TABLE). Read-only is statement-level read-only, not side-effect-free: the statement runs inside a transaction that is always rolled back, which does not undo$INCREMENT/$SEQUENCEcounters (row ID counters included), process-private or IRISTEMP globals, changes made with%NOJOURNby a function, procedure or trigger the statement runs, work that parallel query worker processes do (%PARALLEL),JOBor device output, other external effects, or a function, procedure or trigger that starts, commits or rolls back a transaction (reported as an error when the transaction level the tool opened has changed, which a commit followed by a newTSTARTdoes not show; some changes may be saved). A capped statement that is rolled back leaves the same effects. A capped INSERT, UPDATE or DELETE on a table stored in IRISTEMP (not journaled) keeps its row changes even when the cap rolls it back. Both tools run through the ExecuteMCPv2/dev/sql/executeendpoint, which the bootstrap deploys;iris_sql_queryalways runs read-only.SQL privileges (Story 45.1): both SQL tools prepare each statement with SQL privilege checking on, as the account the server connects with. The account needs SELECT (INSERT, UPDATE or DELETE for writes) on each table and EXECUTE on each SqlProc function or procedure it calls, plus each SQL administrative privilege a statement uses (for example
%CREATE_TABLEfor CREATE TABLE,%NOTRIGGERfor TRUNCATE TABLE,%NOJOURNfor a statement with%NOJOURN; IRIS words that refusalUser <name> does not have <privilege> privileges). A missing grant is anSQL errorwithSQLCODE: -99before any read-only or cap check, so it answers ahead ofSQL_READ_ONLYandSQL_ROWS_AFFECTED_CAP, and nothing runs. This holds for the privileges IRIS checks at prepare (SELECT, INSERT, UPDATE, DELETE, TRUNCATE TABLE, CALL and SqlProc calls, CREATE TABLE,%NOJOURN); IRIS checks GRANT and some DDL (for example CREATE INDEX) only at execution, so those are refused there, or by a read-only or cap check that applies first. The minimum account for the SQL tools holds the%Developmentresource (U) and the namespace's database resource (Rfor reads,RWfor writes), plus the SQL grants. Residual: IRIS's own Atelieraction/query(used by other tools, and reachable by the same account) prepares with checking off, and the same account can read globals and run ObjectScript through other tools, so its database resources, not its SQL grants, bound the data; the full trust model is in the suite README. Default state: always on, with no setting. The minimum account holdsRon three database resources, which are often one: the database that holds theExecuteMCPv2classes (the routines database of the namespace the suite was installed in), the default globals database of that install namespace, and the database that holds the data a statement touches (RWfor writes). With a split or mapped layout, grantRon each; without it the route answers HTTP 500 (<PROTECT>) or HTTP 403. See What the safety settings protect.SQL resource caps (optional, opt-in): an operator may set
IRIS_SQL_MAX_ROWS(a ceiling on the number of rowsiris_sql_executeandiris_sql_queryreturn — the response carriesrowsCapped: truewhen it clamps the caller's request, distinct from the pre-existingtruncated/totalAvailable; it bounds the returned row count post-fetch, not the server-side result set or transfer) and/orIRIS_SQL_TIMEOUT(a per-request timeout in seconds) as environment variables. Both are unset by default (no cap, today's behavior) and apply regardless ofIRIS_GOVERNANCE_PRESET. Details: suite README.
iris_execute_testsandiris_test_coveragewait budget (optional, opt-in — Story 36.1; Story 40.1): an operator may setIRIS_TEST_TIMEOUT(the tools' DEFAULT wait budget, in seconds, before either returns a "running" result instead of blocking further) as an environment variable. Unset by default — each tool keeps its 120-second default. It applies to every server profile (namedIRIS_PROFILESentries inherit it, likeIRIS_SQL_TIMEOUT). A per-calltimeoutargument, when given, takes precedence overIRIS_TEST_TIMEOUT. See theiris_execute_testsdetail section below for the full running-result contract.
Server Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_server_info |
Get IRIS version, platform, instance name | (none) | readOnly, idempotent |
iris_server_namespace |
Get namespace details and features | namespace? |
readOnly, idempotent |
Global Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_global_get |
Read a global node value | global, subscripts?, namespace? |
readOnly, idempotent |
iris_global_set |
Set a global node value (verified) | global, value, subscripts?, namespace? |
destructive, idempotent |
iris_global_kill |
Delete a global node or subtree | global, subscripts?, namespace? |
destructive, idempotent |
iris_global_list |
List globals with optional filter | filter?, caseSensitive?, cursor?, namespace? |
readOnly, idempotent |
Execution Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_execute_command |
Execute an ObjectScript command | command, namespace? |
destructive |
iris_execute_classmethod |
Invoke a class method by name with up to 20 positional arguments (plain scalars or {byRef, value?} markers for ByRef/Output parameters). Captures any Write output from the target (no wrapper class needed for narrating methods, stock runners like %UnitTest.Manager.RunTest, or targets that switch namespace mid-call) and returns marked positions' post-call values |
className, methodName, args?, namespace? |
destructive |
iris_execute_tests |
Run unit tests (package, class, or method level). A run that outlives its wait budget returns a non-error "running" result carrying jobId/runIndex handles instead of a timeout error — see detail below. Since Story 40.3 a run that includes %UnitTest.TestProduction tests is refused with PRODUCTION_BUSY while a different production runs in the namespace (the tool stays enabled; no new key). Classified write because it runs test code, and enabled by default (a key of the frozen baseline); since Story 40.4 its annotations say so (not read-only, not idempotent) |
target, level, timeout?, namespace? |
-- |
Code Metrics Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_loc_count |
Count lines of code in the namespace's ObjectScript documents (CLS/MAC/INT/INC): blank / source code / source comment / test code / test comment buckets, percentages, and the top-N largest documents. spec is REQUIRED (whole-namespace scans need an explicit * and risk the ~60s gateway timeout); compiler-generated documents are excluded by default |
spec, namespace?, includeGenerated?, topN?, format? |
readOnly, idempotent |
Governance defaults:
iris_loc_countis classifiedreadand is therefore enabled by default — it is not gated behindIRIS_GOVERNANCE. (Areadclassification is still required for every new tool key, but reads resolve enabled under the default seed.)
Environment Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_env_diff |
Compare two configured IRIS profiles (source vs target) across up to five domains — documents, mappings, defaultSettings, webapps, config — and report a structured drift report. Default domains (no spec needed): mappings, defaultSettings, webapps, config; documents is opt-in only and requires spec (a bare * is refused unless allowWide is set). Credential-ish System Default Settings values are redacted |
source, target, domains?, spec?, allowWide?, namespace?, ignoreTimestamps? |
readOnly, idempotent |
iris_env_promote |
Turn a prior iris_env_diff result into an ordered promotion plan (action: "plan"), or execute an allowlisted subset of that plan against target (action: "execute") behind four refuse-before-any-write gates: confirm, a steps allowlist, plan-hash freshness (the same diff re-hashed), and the target profile's own governance. Halts on the first failed step; never deletes a target-only item. Before the confirmation dialog and any write, execute reads the source and target copy of each class it would promote, and a source copy that drops a Storage definition the target class has refuses the whole execute with STORAGE_DROPPED |
action, source, target, diff?, plan?, steps?, confirm?, namespace?, allowStorageRegeneration? (default: false: execute is refused before any write if a source class lacks a Storage definition the target class has; true: the classes are promoted, IRIS generates new storage on the target at the next compile, and the dialog and the result's storageDrops name the dropped definitions; execute only) |
destructive |
Governance defaults:
iris_env_diffandiris_env_promote'splanaction are classifiedreadand are therefore enabled by default — neither is gated behindIRIS_GOVERNANCE.iris_env_promote'sexecuteaction is truthfully classifiedwriteand is DEFAULT-DISABLED (unlikeiris_production_control:clean, it deliberately does not use thedefaultEnabledmechanism — promotion is a real environment-mutating write, not a recovery action); enable it viaIRIS_GOVERNANCE, e.g.{"global":{"iris_env_promote:execute":true}}—executeALSO requires the target profile's own governance to allow the underlying write families it uses (a fourth gate on top of this one). Safety: nothing on the target is ever deleted — items that exist on the target only (onlyInTarget) are always informational warnings, never steps — and System Default Settings values that look like credentials are redacted in both diff and plan/execute output; their plaintext never appears in any tool result. Credentials/users/roles promotion is out of scope entirely.
Human confirmation (Story 43.3):
iris_env_promoteactionexecute(a write, default-disabled) also asks the person right before its first write, after the four gates pass, when the MCP client declares form elicitation; any other client keeps today's contract (confirm: trueand the gates), and declining ends the call withCONFIRMATION_DECLINEDand changes nothing. Since Story 44.3 the answer is bound to every Storage drop the promotion found: when the drops change while the person is answering, the person is asked again once with the new drops, and a second change ends the call withCONFIRMATION_SCOPE_CHANGEDand changes nothing. A Claude CodeElicitationhook can answer the dialog for the person, which is the user's choice and removes the person from the loop. See Human confirmation (elicitation).
Storage guard (Story 42.11):
executeruns a read-only preflight after its four gates and the blank-namespace check, and before the confirmation dialog: for each allowlisted class step it reads the source copy and the target copy of the class. A source copy that lacks a Storage definition the target class has refuses the whole execute withSTORAGE_DROPPED(structuredContentis{code, source, target, storageDrops}) and nothing is changed in any domain.allowStorageRegeneration: true(default false) lets it through; the dialog's scope then names the drops (; drops Storage definitions: ...) and the result gainsstorageDrops. Each class is written with the source text the preflight read, so the text checked is the text written. A preflight read that fails fails that step when its turn comes, as today's source-read failure does; a declined dialog leaves reads only.
Test Status Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_test_status |
Companion to iris_execute_tests (Story 36.2): re-attach to a test run by jobId and/or read it by runIndex (action: "poll"), or stop a running one (action: "cancel") — see detail below. Since Story 40.1 it is also the companion of iris_test_coverage: pass coverageRunId alone to poll or cancel a coverage run. Since Story 40.2 action: "export" writes a completed coverage run's Cobertura XML file to an absolute outputPath. Defaults: poll is a read, enabled by default; cancel and export are writes, DEFAULT-DISABLED (enable them through IRIS_GOVERNANCE) |
action, jobId?, runIndex?, coverageRunId?, namespace?, outputPath?, sourceRoot? |
destructive |
Governance defaults:
iris_test_status:pollis classifiedreadand is therefore enabled by default.iris_test_status:cancelis truthfully classifiedwriteand is DEFAULT-DISABLED (it deliberately does not use thedefaultEnabledmechanism — stopping a run is not a recovery-of-last-resort action likeiris_production_control:clean); enable it viaIRIS_GOVERNANCE, e.g.{"global":{"iris_test_status:cancel":true}}. The optionalcoverageRunId(Story 40.1) added no action and changed neither key.iris_test_status:export(Story 40.2) is a third key: it is truthfully classifiedwrite(it writes a local file) and is DEFAULT-DISABLED; enable it viaIRIS_GOVERNANCE, e.g.{"global":{"iris_test_status:export":true}}. It is outside the frozen governance baseline and carries nodefaultEnabledmarker; the tool's annotations (destructiveHint: true) already cover overwriting a file, andiris_test_coverageitself never writes a file.
Test Coverage Tools
| Tool | Description | Key Parameters | Annotations |
|---|---|---|---|
iris_test_coverage |
Run unit tests and measure which lines of the listed classes they execute (Stories 40.1 and 40.2): per class and per method over the class's own source lines with the uncovered ranges, per-routine INT lines, an optional minCoverage verdict, plus the classes that could not be measured; since Story 40.3 it asks the same TestProduction guard as iris_execute_tests and refuses a run with PRODUCTION_BUSY. A write, DEFAULT-DISABLED (it starts an instance-wide Line-by-Line session and runs test code; enable it with IRIS_GOVERNANCE={"global":{"iris_test_coverage":true}}); minCoverage omitted means no verdict — see detail below |
target, level, classes, timeout?, namespace?, minCoverage? |
destructive |
Governance defaults:
iris_test_coverageis truthfully classifiedwrite(it starts an instance-wide monitor session, runs test code and prunes its own older run records) and is DEFAULT-DISABLED; enable it viaIRIS_GOVERNANCE, e.g.{"global":{"iris_test_coverage":true}}. It is outside the frozen governance baseline, uses nodefaultEnabledmarker, and is hidden underIRIS_TOOLS_PRESET=core(shown underdeveloper); it andiris_test_statusare a declared pair and stay co-visible.
Prompts
Workflow-shaped MCP prompts (Epic 25) served via prompts/list/prompts/get. Prompts are a separate protocol capability from tools — they carry no governance key and do not change this server's tool count.
| Prompt | Description |
|---|---|
diagnose-slow-query |
Runs iris_sql_analyze (explain → indexUsage → stats) and recommends a fix — never auto-applies one. |
deploy-and-test-class |
Deploys an ObjectScript class or package (iris_doc_load, glob-path form), resolves compile errors, then runs its unit tests (iris_execute_tests) with a total-count check. It tells the model what a PRODUCTION_BUSY refusal means (a production other than the tests' own is running, or the production state could not be read), and, only when the user asks for coverage, adds an optional last step that runs iris_test_coverage and copes with a hidden tool (outside core), a GOVERNANCE_DISABLED or MONITOR_BUSY refusal and a running result (Story 40.4). |
promote-environment-change |
Reviews and promotes configuration/code drift from a source IRIS environment to a target using the review-before-write iris_env_diff → iris_env_promote workflow — scoped diff, review with the user, plan, an explicit user-selected step allowlist, confirmed execute, then re-diff to verify. Never acts on onlyInTarget warnings; states the no-deletions guarantee and that execute is default-disabled. |
edit-and-test-class |
Changes a few lines of a class in place: a ranged iris_doc_get, a guarded iris_doc_edit (apply, enabled by default; expected built from the read, with a STALE_CONTENT retry using mismatches[].current), iris_doc_compile, then iris_execute_tests with a check of total against the number of Test* methods. Takes className, change and an optional testClass; every tool on its main path is in the core preset. It tells the model what a PRODUCTION_BUSY refusal means (a production other than the tests' own is running, or the production state could not be read) and not to stop a production without the user's confirmation. |
objectscript-review was retired in Story 41.2: its checklist is now the always-on rule in the skills pack, which iris-mcp-clients skills install puts where each client loads it (.claude/rules/ for Claude Code, .cursor/rules/ for Cursor, a marked block in GEMINI.md for Gemini CLI and in AGENTS.md for every other client).
Also installable as Agent Skills.
Tool Examples
Input:
{
"name": "MyApp.Service.cls",
"namespace": "USER"
}
Output:
{
"name": "MyApp.Service.cls",
"content": ["Class MyApp.Service {", "", "ClassMethod Hello() As %String", "{", " Quit \"Hello World\"", "}", "", "}", ""],
"ts": "2026-04-07 10:30:00.000"
}
Pass startLine and/or endLine (1-based, inclusive) to read part of a class, routine or include file instead of
the whole document. Use a range for large classes, and to read the exact lines before changing them with
iris_doc_edit, which uses the same line numbers. A ranged read is still one request for the whole document; the
lines are cut from it afterwards, so it saves the agent's context, not IRIS's work.
Input:
{
"name": "MyApp.Service.cls",
"startLine": 3,
"endLine": 5
}
Output (text): a header line, then the lines in the cat -n layout: the line number right-aligned in 6 columns, a
tab, then the line exactly as IRIS holds it (leading tabs, trailing spaces and empty lines included).
Document 'MyApp.Service.cls' in namespace 'USER': lines 3-5 of 9 (ts 2026-04-07 10:30:00.000)
3 ClassMethod Hello() As %String
4 {
5 Quit "Hello World"
Output (structuredContent):
{
"name": "MyApp.Service.cls",
"ts": "2026-04-07 10:30:00.000",
"startLine": 3,
"endLine": 5,
"totalLines": 9,
"lines": ["ClassMethod Hello() As %String", "{", " Quit \"Hello World\""]
}
- Numbering. Line N is element N-1 of the line array that IRIS returns, after one leading byte-order mark is removed.
A class ends with an empty last line, and it counts:
totalLinesis 9 for the 9-elementcontentarray of the full-read example above, whose last element is that empty line.iris_loc_countreports the sametotalLinesfor a class. A routine's or include file's line 1 is itsROUTINEheader:ROUTINE <name>for a.macroutine (IRIS drops the type),ROUTINE <name> [Type=INC]for an include file. - Defaults and clamp.
startLinealone reads to the last line;endLinealone reads from line 1. AnendLinepast the end is clamped to the last line, and the response shows the effectivestartLineandendLine. ts. The document's version timestamp, the same stringmetadataOnlyreturns asetag.iris_doc_editsends it back to IRIS so that an edit cannot overwrite a change it did not see.- Without the parameters the request and the result are unchanged: the whole document, as before.
- Errors (
isError: true, nothing is read into the result):startLineorendLineis not a whole number of at least 1: the argument check refuses it before the tool runs (anInvalid argumentserror that names the parameter).startLineis afterendLine, or past the last line (the message states the document'stotalLines).- A range with
metadataOnly, or withformat: "xml": ranges apply only to UDL text. - A binary document (the message names it), or a document IRIS cannot read (the message names it and carries IRIS's reason).
Debug/scratch tool — for production code, use iris_doc_load to ensure source
control and review. This tool writes content directly to IRIS without creating a
file on disk, and is intended for one-off inspection, quick reproductions, or
throwaway test classes only. A leading byte-order mark is stripped from the content
before it is sent, and a write IRIS refuses (a non-empty result.status inside an
HTTP 200 response) is returned as an error carrying IRIS's text; nothing is stored then.
- Existing documents. A document that does not exist yet is created by one request. For a document that exists,
IRIS refuses an unversioned write with HTTP 409 and the document's current text and version; the tool uses that
answer as its read, then saves once more with
If-None-Matchset to that version. A 409 on that save means the document changed meanwhile: the tool returns aDOCUMENT_CONFLICTrefusal (nothing stored) and never retries.ignoreConflict(default false) skips the version check. No path sends an extra GET or HEAD. - Storage guard. A persistent class keeps its Storage definitions (the map from properties to the globals that
hold its rows) in its source. A write to an existing class whose content drops one of those definitions is refused
with
STORAGE_DROPPEDand nothing is stored, because IRIS would generate new storage at the next compile, which can change how existing rows are read. Names are compared exactly: a rename is a drop, and changing a definition's content is allowed.allowStorageRegeneration: true(default false) lets the write through, and then the next compile regenerates the storage. The guard applies to.clsdocuments only, in UDL or XML form, and a new class is never refused. It reads the class text the way IRIS does for the forms it is tested against; in a few hand-written forms (a brace hidden in embedded SQL or HTML, for example) it can miss a drop. The same guard covers every path that can replace an existing class, each with the same parameter:iris_doc_putrefuses the write, as above.iris_doc_loadreads each class file's class before its upload (one GET; withignoreConflict: falsethe 409 of the first PUT is the read), and refuses a file that drops a definition as afailuresentry withSTORAGE_DROPPEDwhile the other files continue. WithallowStorageRegeneration: truethe result'sstorageDropsnames what was dropped.- The
iris_doc_xml_exportimport reads each<Class>of the XML before its one POST, and refuses the whole import when a class lacks a definition the class has now. With the override the result'sstorageDropsnames them. iris_env_promoteexecutereads the source and target copy of each class before its confirmation dialog, and refuses the whole execute when a source copy lacks a definition the target class has. It writes the source text it read. With the override the dialog and the result'sstorageDropsname the dropped definitions. When the drops and the steps together are longer than the dialog shows (600 characters), fewer steps are listed, then fewer dropped classes, each list endingand N more, so that the drops stay visible.- Each call reads each class once, one GET after another, before it writes it. A change made to the class between that read and the write is not seen. On a promote the read comes before the confirmation dialog and before the mapping steps of the same plan; a client that answers the dialog in a second request runs the call again, so that request reads each class again and writes what it read, without comparing it with the drops the dialog named. A very large load, import or promote makes proportionally more requests.
- Document-write paths. The guard covers
iris_doc_put,iris_doc_edit(actionapply),iris_doc_load, theiris_doc_xml_exportimport and theiris_env_promoteexecutesync;iris_doc_editis overridden by itsregenerateStorageaction instead of the parameter. The bootstrap's own classes have no Storage definitions.iris_docdb_documentandiris_global_setwrite DocDB records and global nodes, not documents. A test lists every document-writing path with its verdict.
Input:
{
"name": "MyApp.Utils.cls",
"content": "Class MyApp.Utils {\n\nClassMethod Add(a As %Integer, b As %Integer) As %Integer\n{\n Quit a + b\n}\n\n}"
}
Output:
"Document 'MyApp.Utils.cls' saved successfully in namespace 'USER'."
Refusal (isError: true, nothing stored) when the class has Storage definitions Default and Second and the
content keeps only Default:
Document 'MyApp.Orders.cls' was not saved in namespace 'USER': the content drops the Storage definition 'Second' that the class has now, and IRIS would generate new storage at the next compile, which can change how existing rows are read. Nothing was stored. Keep the Storage definitions in the content (read the class with iris_doc_get first), or pass allowStorageRegeneration: true to let IRIS regenerate the storage.
{
"code": "STORAGE_DROPPED",
"name": "MyApp.Orders.cls",
"namespace": "USER",
"droppedStorage": ["Second"]
}
Change a few lines of an existing class, routine or include file without resending the whole document. Read the exact
lines first with a ranged iris_doc_get (the two tools use the same 1-based line numbers and are always visible
together), then send the edits. Each edit is an insert (afterLine, text, expected; afterLine: 0 inserts before
line 1), a delete (startLine, endLine, expected) or a replace (startLine, endLine, text, expected),
addressed in the numbering of that read.
- Default state.
action: "apply"is a write that is enabled by default, the one exception to "a new write ships disabled" besidesiris_production_control:clean(Project Lead decision S-3). Every edit is guarded by theexpectedtext of the lines it changes, the save is version-checked, and a class edit that would drop a Storage definition is refused, so it does not overwrite a line whose text differs from what the agent expected. Disable it with{"global": {"iris_doc_edit:apply": false}}, or by disablingiris_doc_put(a disablediris_doc_putmakes bothiris_doc_editkeys seed disabled, reported asconfigSource: "parent"; an explicit setting oniris_doc_edit:applystill wins). The read-only preset blocks it too.action: "regenerateStorage"(the Storage-guard override, below) is disabled by default. See Parent keys. Human confirmation (Story 43.3):action: "regenerateStorage"also asks the person right before the save, when the MCP client declares form elicitation; any other client keeps today's contract (governance is the only gate, there is noconfirmparameter), and declining ends the call withCONFIRMATION_DECLINEDand changes nothing. A Claude CodeElicitationhook can answer the dialog for the person, which is the user's choice and removes the person from the loop. See Human confirmation (elicitation). expected. The current text of the addressed lines (of lineafterLine, or line 1 whenafterLineis 0, for an insert).textandexpectedare parsed alike: one leading byte-order mark is dropped, one trailing line break is dropped, and CRLF and LF both separate lines, so"a\nb\n"and"a\r\nb"are both the two linesa,b. An emptytextis one empty line; to remove lines usedelete. Makeexpecteddistinctive when a line such as}is not unique: if another writer shifted lines before this tool's read, a non-unique line can still match.- All or nothing. The tool reads the document once, checks every edit (shape, overlaps, line numbers,
expected, Storage), applies them all bottom-up against the numbering of that read, and saves once withIf-None-Matchset to the version it read. Edits may come in any order. Two edits that address the same lines, or an insert inside a range another edit changes, are rejected before any request. Lines no edit touches are sent byte-identical. - Refusals (
isError: true, nothing stored):STALE_CONTENTlists every edit whoseexpectedtext differs from the document now, with the current text;DOCUMENT_CONFLICTmeans the document changed after the tool read it (never retried, and noignoreConflictexists);STORAGE_DROPPEDis the Storage guard ofiris_doc_put, with this remedy: keep the Storage definitions in the edited lines, or run the same edits withaction: "regenerateStorage". Retrying aSTALE_CONTENTrefusal: each mismatch'scurrentis the addressed lines joined with\n, plus one trailing\n, so passing it back unchanged as that edit'sexpectedmatches whenever the document still holds those lines, including a range that ends in an empty line. Anexpectedbuilt from a rangediris_doc_getread ends every line, the last included, with a line break. The refusal's text block (the numbered lines) is unchanged. Argument and range errors carry no code. IRIS refusing the text (a non-emptyresult.statusinside an HTTP 200 response) is returned as an error carrying IRIS's text. - The answer is a re-read. IRIS reformats class source when it saves (it puts a blank line between members, for
example), so the tool reads the document back and answers from that:
unifiedDiff(3 context lines, the read against the re-read), one excerpt per edit (the lines the edit produced, plus 3 context lines on each side, as in a rangediris_doc_getof the same range), the newtotalLinesandts. Never the whole document. An edit whose result equals the stored text saves nothing and reportschanged: false. A class edit that IRIS stores back as it was (it restores a deleted blank line between members, for example) is saved, re-read and also reported aschanged: false, with an emptyunifiedDiffand a text saying so. - No compile. The tool does not compile: run
iris_doc_compilenext.
Input:
{
"action": "apply",
"name": "MyApp.Service.cls",
"namespace": "USER",
"edits": [
{ "op": "insert", "afterLine": 3, "text": "/// Says hello.", "expected": "" },
{
"op": "replace",
"startLine": 6,
"endLine": 6,
"text": " Set name = $Get(^Names, \"World\")\n Quit \"Hello \" _ name",
"expected": " Quit \"Hello World\""
}
]
}
Output (text): the sentence, the diff, then one numbered excerpt per edit:
Document 'MyApp.Service.cls' edited in namespace 'USER': 2 edits applied; it has 12 lines now (ts 2026-04-07 10:31:12.000). It is not compiled: run iris_doc_compile next.
--- MyApp.Service.cls 2026-04-07 10:30:00.000
+++ MyApp.Service.cls 2026-04-07 10:31:12.000
@@ -1,9 +1,11 @@
Class MyApp.Service Extends %RegisteredObject
{
+/// Says hello.
ClassMethod Hello() As %String
{
- Quit "Hello World"
+ Set name = $Get(^Names, "World")
+ Quit "Hello " _ name
}
}
Edit 1 (insert after line 3), now lines 1-7:
1 Class MyApp.Service Extends %RegisteredObject
2 {
3
4 /// Says hello.
5 ClassMethod Hello() As %String
6 {
7 Set name = $Get(^Names, "World")
Edit 2 (replace lines 6-6), now lines 4-11:
4 /// Says hello.
5 ClassMethod Hello() As %String
6 {
7 Set name = $Get(^Names, "World")
8 Quit "Hello " _ name
9 }
10
11 }
Output (structuredContent):
{
"name": "MyApp.Service.cls",
"namespace": "USER",
"ts": "2026-04-07 10:31:12.000",
"totalLines": 12,
"changed": true,
"unifiedDiff": "--- MyApp.Service.cls\t2026-04-07 10:30:00.000\n+++ MyApp.Service.cls\t2026-04-07 10:31:12.000\n@@ -1,9 +1,11 @@\n Class MyApp.Service Extends %RegisteredObject\n {\n \n+/// Says hello.\n ClassMethod Hello() As %String\n {\n- Quit \"Hello World\"\n+ Set name = $Get(^Names, \"World\")\n+ Quit \"Hello \" _ name\n }\n \n }",
"excerpts": [
{ "edit": 1, "op": "insert", "startLine": 1, "endLine": 7, "lines": ["Class MyApp.Service Extends %RegisteredObject", "{", "", "/// Says hello.", "ClassMethod Hello() As %String", "{", " Set name = $Get(^Names, \"World\")"] },
{ "edit": 2, "op": "replace", "startLine": 4, "endLine": 11, "lines": ["/// Says hello.", "ClassMethod Hello() As %String", "{", " Set name = $Get(^Names, \"World\")", " Quit \"Hello \" _ name", "}", "", "}"] }
]
}
Refusal (isError: true, nothing stored) when a replace of line 6 expected Quit "Hello" but the line reads
Quit "Hello World":
Document 'MyApp.Service.cls' was not changed in namespace 'USER': the expected text of edit 1 does not match the document now. Nothing was stored. Retry with the current text below as expected, or read the lines again with iris_doc_get.
Edit 1 (replace lines 6-6), current text:
6 Quit "Hello World"
{
"code": "STALE_CONTENT",
"name": "MyApp.Service.cls",
"namespace": "USER",
"ts": "2026-04-07 10:30:00.000",
"totalLines": 10,
"mismatches": [
{ "edit": 1, "op": "replace", "startLine": 6, "endLine": 6, "current": " Quit \"Hello World\"\n" }
]
}
Input:
{
"name": ["MyApp.Temp1.cls", "MyApp.Temp2.cls"]
}
Output:
"2 document(s) deleted from namespace 'USER': MyApp.Temp1.cls, MyApp.Temp2.cls"
Input:
{
"category": "CLS",
"filter": "MyApp"
}
Output:
{
"items": [
{ "name": "MyApp.Service.cls", "ts": "2026-04-07T10:30:00Z" },
{ "name": "MyApp.Utils.cls", "ts": "2026-04-07T10:25:00Z" }
]
}
Input:
{
"path": "c:/projects/myapp/src/**/*.cls",
"compile": true
}
Output:
{
"total": 5,
"uploaded": 5,
"failed": 0,
"compilationResult": {
"success": true,
"documents": ["MyApp.Service.cls", "MyApp.Utils.cls", "MyApp.Model.cls", "MyApp.REST.cls", "MyApp.Tests.cls"]
}
}
Glob shape matters (Story 35.9). The base for document-name mapping is the directory prefix
before the first glob metacharacter, so the wildcard must come BEFORE the package directory.
.../src/ClineTest/*.cls swallows the ClineTest package directory into the base and would map
ClineTest/Wumpus.cls to the unqualified Wumpus.cls. The tool now REFUSES such uploads: for
.cls/.mac/.int/.inc files whose own Class <Pkg.Name> / ROUTINE <Name> declaration
disagrees with the path-derived name, the file lands in failures[] with both names named and is
never uploaded or compiled (IRIS would otherwise store it under the content-declared name while the
tool reported the wrong one). Headerless files (.inc fragments, CSP pages) have no declaration and
keep pure path-derived naming.
BOM and server-reported per-file errors (Story 35.9 rework). A leading UTF-8 BOM is stripped
before upload (IRIS rejects a BOM'd first line as an illegal header). And a PUT that returns
HTTP 200 can still fail per-document — Atelier reports it only as a string status field in the
per-doc result (e.g. ERROR #16021: Illegal Header Line: ...) while storing nothing. The tool
surfaces that string as an upload failure in failures[] instead of counting the file as uploaded.
Storage guard (Story 42.11). For a .cls file, the tool reads the class that exists now before it uploads (one
GET; with ignoreConflict: false the 409 of the unversioned PUT is that read). A file whose content drops one of the
class's Storage definitions is not stored, and its failures[] entry carries code: "STORAGE_DROPPED" and the dropped
names in droppedStorage; the other files continue, and a refused file is not compiled. allowStorageRegeneration: true (default false) uploads it anyway, and the result gains storageDrops, for example
[{"name": "MyApp.Model.cls", "droppedStorage": ["Default"]}]. A new class, a non-class document and a file that keeps
every definition upload exactly as before. A read that fails (other than a 404, which means a new class), or a class
that cannot be read as text, fails that file with the read's error and nothing is stored for it; the other files continue.
Refused input (trap-shaped glob):
{
"path": ".../src/ClineTest/*.cls",
"compile": true
}
Refusal output:
{
"total": 2,
"uploaded": 0,
"failed": 2,
"failures": [
{
"file": ".../src/ClineTest/Wumpus.cls",
"docName": "Wumpus.cls",
"error": "Refusing to upload 'Wumpus.cls': the path-derived name does not match the file's declared identity 'ClineTest.Wumpus'. The glob pattern's base directory swallowed the package directory — use a wildcard before the package directory (e.g. '.../src/**/*.cls') or pass baseDir='.../src'."
}
]
}
Two remedies, both work: move the wildcard before the package directory
("path": ".../src/**/*.cls"), or keep the narrow glob and state the package root
deterministically with the optional baseDir parameter:
{
"path": ".../src/ClineTest/*.cls",
"baseDir": ".../src",
"compile": true
}
Both upload ClineTest.Wumpus.cls / ClineTest.WumpusCave.cls and compile clean. baseDir does
not bypass the content cross-check — it is defense-in-depth, not an override.
Input (happy path — export a namespace subtree):
{
"destinationDir": "C:/dev/iris-export",
"prefix": "MyApp",
"category": "CLS",
"namespace": "USER"
}
Output:
{
"destinationDir": "C:/dev/iris-export",
"namespace": "USER",
"filtersApplied": {
"prefix": "MyApp",
"category": "CLS",
"type": "*",
"generated": "false",
"system": "false"
},
"total": 5,
"exported": 5,
"skipped": 0,
"skippedItems": [],
"manifest": "C:/dev/iris-export/manifest.json",
"durationMs": 412
}
Files are written to C:/dev/iris-export/MyApp/Service.cls, C:/dev/iris-export/MyApp/Utils.cls, etc. Dots in dotted class names become subdirectories; CSP paths keep their forward slashes.
Input (Windows long-path — needs useShortPaths):
{
"destinationDir": "C:/dev/iris-export",
"prefix": "EnsLib.HL7",
"namespace": "USER"
}
Output with skippedItems:
{
"destinationDir": "C:/dev/iris-export",
"namespace": "USER",
"filtersApplied": { "prefix": "EnsLib.HL7", "category": "*", "type": "*", "generated": "false", "system": "false" },
"total": 42,
"exported": 40,
"skipped": 2,
"skippedItems": [
{
"docName": "EnsLib.HL7.MessageRouter.VeryLongClassNameThatExceedsMaxPath.cls",
"reason": "ENAMETOOLONG: local path exceeds 260 characters on Windows",
"hint": "Rerun with useShortPaths: true, or enable Windows long-path support in the registry (LongPathsEnabled)."
},
{
"docName": "EnsLib.HL7.MessageRouter.AnotherVeryLongClassName.cls",
"reason": "ENAMETOOLONG: local path exceeds 260 characters on Windows",
"hint": "Rerun with useShortPaths: true, or enable Windows long-path support in the registry (LongPathsEnabled)."
}
],
"manifest": "C:/dev/iris-export/manifest.json",
"durationMs": 3821
}
Excerpt of manifest.json:
{
"namespace": "USER",
"exportedAt": "2026-04-20T15:30:00.000Z",
"filtersApplied": { "prefix": "EnsLib.HL7", "category": "*", "type": "*", "generated": "false", "system": "false" },
"files": [
{ "docName": "EnsLib.HL7.Adapter.TCPInboundAdapter.cls", "localPath": "EnsLib/HL7/Adapter/TCPInboundAdapter.cls", "bytes": 2847 },
{ "docName": "EnsLib.HL7.Service.Standard.cls", "localPath": "EnsLib/HL7/Service/Standard.cls", "bytes": 5219 }
],
"skipped": [
{
"docName": "EnsLib.HL7.MessageRouter.VeryLongClassNameThatExceedsMaxPath.cls",
"reason": "ENAMETOOLONG: local path exceeds 260 characters on Windows",
"hint": "Rerun with useShortPaths: true, or enable Windows long-path support in the registry (LongPathsEnabled)."
}
],
"shortPathMap": null
}
Note on CSP static assets in system namespaces. The Atelier API lists static web files (CSS, JS, images under
/csp/…/*.css,*.js, etc.) indocnamesbut returns HTTP 404 for those paths onGET /doc/{name}— they're served by the CSP Gateway, not stored in an Atelier-accessible store. A full export of a namespace like%SYS(or any namespace mapping IRIS system CSP routes) will therefore produce a largeskippedItemslist — on a stock IRIS 2025.1%SYSnamespace, ~2,174 of 6,131 docnames fall into this bucket. This is an IRIS-side asymmetry, not a tool defect. To avoid the noise when you only want code, passcategory: "CLS"(classes) orcategory: "RTN"(routines + include files) — these restrictdocnamesto categories whose documents are reliably retrievable.
Input:
{
"prefix": "MyApp",
"depth": 2,
"namespace": "USER"
}
Output:
{
"packages": [
{ "name": "MyApp.Services", "docCount": 12, "depth": 2 },
{ "name": "MyApp.Utils", "docCount": 4, "depth": 2 },
{ "name": "MyApp.Tests", "docCount": 8, "depth": 2 }
],
"count": 3,
"namespace": "USER",
"depth": 2,
"totalDocs": 24
}
For a structural overview at package granularity, use iris_package_list. For individual document names, use iris_doc_list. To pull many documents at once, see iris_doc_export.
Note on CSP static assets in system namespaces. Because
iris_package_listaggregates the same Atelierdocnamesfeed thatiris_doc_exportwalks, it inherits the same system-namespace asymmetry: static web files (CSS, JS, images under/csp/…/*.css,*.js, etc.) appear indocnameseven though they are not stored in an Atelier-retrievable form. On a stock IRIS 2025.1%SYSnamespace thecsppackage row will look inflated (~2,174 of 6,131 docs) for this reason. This is an IRIS-side asymmetry, not a tool defect. To get a clean code-only rollup, passcategory: "CLS"(classes) orcategory: "RTN"(routines + include files) — the same workaround documented foriris_doc_export.
Input:
{
"doc": "MyApp.Service.cls"
}
Output:
{
"success": true,
"documents": ["MyApp.Service.cls"],
"compilationTime": "245ms"
}
The compile check (Story 44.7). IRIS answers a compile with HTTP 200 and no error listed when one class or routine fails in a
compile that also writes the Storage of a persistent class, so the answer alone proves nothing. After a synchronous compile that
listed no error, iris_doc_compile, iris_doc_load (compile: true) and iris_env_promote (execute) ask IRIS itself, without
reading any console text: for a class, the class dictionary (a compiled class with no compile error) and IRIS's up-to-date flag
(docnames); for a .mac routine, the up-to-date flag. A document that is not confirmed makes the result success: false
(iris_doc_compile; errors has one entry with document set to its name), compilationResult.success: false
(iris_doc_load), or a failed step with the later steps skipped (iris_env_promote). iris_doc_compile reads the same
documents of a wildcard (Pkg.*.cls, Pkg.R?.mac; a leading ' excludes) from docnames first. A compile that listed an
error, an async compile and a compile IRIS answered with a status error are reported exactly as before and send no check
request. A check that cannot run fails the result; it is never a pass. A clean compile makes one more Atelier query for each 100 classes it
checks, plus one docnames listing for each package root of those classes and one for each package root of its .mac routines;
a wildcard adds its own docnames listing. flags without c (e.g. k) are checked too: IRIS compiles whatever the flags say.
The check is bounded: a wildcard with no literal prefix (*.cls), one with a wildcard in its extension (Pkg.*), or one that
matches more than 1000 documents is not expanded, so the documents it matches are not checked; the result then carries a
checkNote naming the pattern, and the documents named outright are checked either way. Limit: an include file (.inc) and an .int routine are not checked, because IRIS's up-to-date flag
is true for an include file whether or not anything compiled it, and for an .int also after a failed compile (probe 2026-11-23,
IRIS 2026.2): a failure of only those, in a compile that also writes a class's Storage, still reads as success.
Input:
{
"name": "MyApp.Service.cls"
}
Output:
{
"content": [
{
"name": "MyApp.Service.cls",
"content": [
{ "name": "Hello", "cat": "method", "type": "classmethod", "returnType": "%String" }
]
}
]
}
Input:
{
"query": "Quit \"Hello",
"files": "*.cls"
}
When files is omitted, the tool sends the documented default pattern
*.cls,*.mac,*.int,*.inc on every call — previously the param was silently
dropped when the caller omitted it, which let the Atelier server's narrower
default kick in and returned empty results for matches that lived in .cls
files. Pass an explicit files value to narrow the search.
Output:
{
"matches": [
{ "doc": "MyApp.Service.cls", "line": 5, "text": " Quit \"Hello World\"" }
]
}
Input:
{
"name": "OK",
"document": "MyApp.Service.cls",
"includes": ["%occStatus"]
}
Output:
{
"name": "OK",
"definition": { "value": "1" },
"location": { "file": "%occStatus.inc", "line": 3 }
}
Returns the .1.int routine (or .int for .mac/.int sources) IRIS generates during compilation — the fully macro-expanded form IRIS actually executes at runtime. Useful when you need to see what $$$ macros expand to (e.g., what $$$OK or $$$ThrowOnError resolves to in a specific class's context), or to inspect compiled output without running code.
Pass the bare class/routine name (no .cls extension). The tool auto-resolves by trying candidate document paths in order: <name>.1.int, then <name>.int (the .mac source itself is intentionally NOT a candidate — the macro-expanded intermediate is what this tool returns). The first 2xx response wins; candidatesTried reports which paths were attempted. If all candidates return 404 the tool returns a compile-first hint.
Input:
{
"name": "ExecuteMCPv2.REST.Command",
"namespace": "HSCUSTOM"
}
Output:
{
"name": "ExecuteMCPv2.REST.Command",
"resolvedDoc": "ExecuteMCPv2.REST.Command.1.int",
"namespace": "HSCUSTOM",
"content": "ROUTINE ExecuteMCPv2.REST.Command.1 [Type=INT]\n%File ; ExecuteMCPv2.REST.Command.1 ;(CLS)\nzExecute() public {\n New %sc\n Set %sc=$$$OK\n ...\n}\nzRedirects() public {\n ...\n}",
"candidatesTried": ["ExecuteMCPv2.REST.Command.1.int"]
}
The content string contains the routine body as IRIS compiled it (newline-joined), including the ROUTINE header, methodimpl declarations, and macro-expanded ObjectScript.
Input:
{
"name": "MyApp.Service.cls",
"targetFormat": "xml"
}
Output:
{
"name": "MyApp.Service.cls",
"content": ["<?xml version=\"1.0\"?>", "<Export ...>", "..."]
}
Input:
{
"action": "export",
"docs": ["MyApp.Service.cls"]
}
Output:
{
"content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>..."
}
An import loads definitions without compiling them by default — the response then includes a note saying the documents are NOT compiled (remedy: compile: true, or iris_doc_compile afterwards). Pass compile: true to compile in the same call; flags (e.g. "cku") is honoured only when compile is true, and the c compile qualifier is folded in automatically when absent or explicitly negated (IRIS qualifier letters are case-insensitive; -c negates, so -c becomes -cc — the last c wins). A compile failure still returns HTTP-level success from IRIS — the error text surfaces in the response as a Per-file status (...) note.
Storage guard (Story 42.11). Before its one POST the import reads each <Class> of the XML from the namespace. If a
class that exists lacks one of the <Storage> elements it has now, the whole import is refused with STORAGE_DROPPED
(structuredContent is {code, namespace, storageDrops}) and nothing is loaded; export the classes with
iris_doc_xml_export first to keep their <Storage> elements. allowStorageRegeneration: true (default false)
loads the XML anyway, and the result gains storageDrops. An XML with no <Class>, a new class and a class that keeps
every definition import exactly as before. A read that fails (other than a 404, which means a new class), or a class
that cannot be read as text, ends the call with the read's error before the POST, and nothing is loaded.
Input:
{
"action": "import",
"content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Export generator=\"IRIS\" version=\"26\">\n<Class name=\"MyApp.Service\">\n<Super>%RegisteredObject</Super>\n</Class>\n</Export>",
"compile": true
}
Output:
{
"content": [
{
"file": "import.xml",
"imported": ["MyApp.Service.cls"],
"status": ""
}
]
}
Input:
{
"query": "SELECT Name, Super FROM %Dictionary.ClassDefinition WHERE Name %STARTSWITH ?",
"parameters": ["MyApp."],
"maxRows": 10
}
Output:
{
"columns": ["Name", "Super"],
"rows": [
["MyApp.Service", "%RegisteredObject"],
["MyApp.Utils", ""]
],
"rowCount": 2
}
If the operator has set IRIS_SQL_MAX_ROWS lower than the effective request, the output additionally carries "rowsCapped": true (e.g. IRIS_SQL_MAX_ROWS=5 with maxRows: 10 above would clamp rowCount to 5 and add rowsCapped: true). Unset, this field never appears.
Safety controls (all optional; defaults: readOnly false, maxRowsAffected no cap, countOnly false). A DELETE capped at 2 rows that would change 3 is rolled back and refused:
{ "query": "DELETE FROM Sample.Person WHERE Age > 90", "maxRowsAffected": 2 }
{
"isError": true,
"structuredContent": {
"code": "SQL_ROWS_AFFECTED_CAP",
"namespace": "USER",
"statementType": "DELETE",
"rowsAffected": 3,
"maxRowsAffected": 2,
"capSource": "parameter"
}
}
Within the cap the statement commits and the result is {"columns": [], "rows": [], "rowCount": 0, "rowsAffected": 3}. Under a cap, an INSERT, UPDATE or DELETE whose text contains the %NOJOURN token (a comment or a string counts) is refused with SQL_ROWS_AFFECTED_CAP before it runs and has no rowsAffected, because it turns journaling off and the rollback could not undo it. With readOnly: true (or IRIS_SQL_READ_ONLY=true) any statement that is not a SELECT is refused with SQL_READ_ONLY (structuredContent carries statementType and readOnlySource: parameter, operator or tool), and a SELECT forced by the operator variable carries "readOnlyForced": true. With countOnly: true a SELECT returns {"columns": [], "rows": [], "rowCount": 0, "totalCount": 42} and transfers no rows; rowCount keeps its meaning (rows returned). A function, procedure or trigger that starts, commits or rolls back the transaction this tool opened is reported as an error (no code), also when the statement then fails, because the tool could not check or undo it reliably; a commit followed by a new TSTART leaves the level unchanged and is not seen.
Runs a SQL query (SELECT) in a transaction that is always rolled back. Use it for queries, including under the read-only governance preset, where iris_sql_execute is blocked. Any other statement, CALL included, is refused with SQL_READ_ONLY and readOnlySource: "tool".
Input:
{
"query": "SELECT Name FROM %Dictionary.ClassDefinition WHERE Name %STARTSWITH ?",
"parameters": ["MyApp."],
"maxRows": 10
}
Output: {"columns": ["Name"], "rows": [["MyApp.Service"], ["MyApp.Utils"]], "rowCount": 2}; with countOnly: true, {"columns": [], "rows": [], "rowCount": 0, "totalCount": 2}. IRIS_SQL_MAX_ROWS (rowsCapped) and IRIS_SQL_TIMEOUT apply exactly as they do to iris_sql_execute; IRIS_SQL_READ_ONLY and IRIS_SQL_MAX_ROWS_AFFECTED have nothing to bound here.
Input:
{
"action": "explain",
"query": "SELECT Name FROM %Dictionary.ClassDefinition WHERE Name %STARTSWITH 'Ens'"
}
explain returns the query plan text; indexUsage additionally parses the maps/indexes named in the plan; stats reads cached-statement statistics (INFORMATION_SCHEMA.STATEMENTS); running lists currently-executing statements (INFORMATION_SCHEMA.CURRENT_STATEMENTS). query is required for explain/indexUsage.
Output:
{
"action": "explain",
"plan": "<plans>\n <plan>\n ...\n Read master map %Dictionary.ClassDefinition.Master ...\n </plan>\n</plans>"
}
Input (query mode):
{
"action": "advise",
"query": "SELECT ID, UnindexedCol FROM MyApp.Orders WHERE UnindexedCol = 'X'"
}
Or workload mode (advise the 5 most recent statements instead of one query):
{ "action": "advise", "workload": true, "topN": 5 }
query and workload are mutually exclusive. Recommendations are heuristic; verify with explain before applying any change — advise only recommends and cites evidence, it never applies anything.
Output (structuredContent):
{
"mode": "query",
"findings": [
{
"type": "missing-index",
"confidence": "high",
"statement": "SELECT ID, UnindexedCol FROM MyApp.Orders WHERE UnindexedCol = 'X'",
"evidence": "Predicate column(s) UnindexedCol on MyApp.Orders have no index with it as the leading subscript (existing indexes checked: IDKEY).",
"recommendation": "Consider: CREATE INDEX IdxUnindexedCol ON MyApp.Orders (UnindexedCol). Verify with EXPLAIN after creation.",
"suggestedDdl": "CREATE INDEX IdxUnindexedCol ON MyApp.Orders (UnindexedCol). Verify with EXPLAIN after creation.",
"planExcerpt": "Read master map MyApp.Orders.IDKEY, looping on ID."
}
],
"analyzed": { "statements": 1, "skipped": 0 },
"notes": []
}
When no findings are identified, the response says so explicitly along with what was checked (e.g. "No performance findings (mode: query). Checked 1 statement ...") rather than returning silently empty. In workload mode, a statement that fails to EXPLAIN is counted in analyzed.skipped, not treated as a fatal error; if the recent-statement workload source itself is unavailable on your IRIS edition/version, the call returns a clear capability message instead of a raw SQL error.
Input:
{
"spec": "MyApp.*.cls,*.mac",
"topN": 5
}
spec is REQUIRED (comma-delimited, */? wildcards) — a whole-namespace scan needs an explicit "*" and risks the ~60s gateway timeout on large namespaces. Compiler-generated documents (e.g. the .int code generated from a class) are excluded by default; pass includeGenerated: true to count them. System (%-prefixed) documents are excluded from wildcard scans — name them explicitly (e.g. %Z*.cls) to count them — and spec parts should not overlap: an exact document name listed before a wildcard part that also matches it can drop documents (an IRIS StudioOpenDialog spec quirk). format: "csv" renders metric,value rows instead of the ASCII table (client-side only — structuredContent always carries the full object).
Output (structuredContent):
{
"filesParsed": 44,
"totalLines": 16215,
"blankLines": 1413,
"sourceCodeLoc": 8677,
"sourceCommentLoc": 2463,
"testCodeLoc": 2997,
"testCommentLoc": 665,
"codePct": 72.0,
"sourceCodePct": 53.5,
"testCodePct": 18.5,
"commentPct": 19.3,
"whitespacePct": 8.7,
"topDocuments": [
{ "name": "MyApp.REST.Api.cls", "type": "cls", "totalLines": 3186, "codeLoc": 2283, "commentLoc": 634, "isTest": false }
],
"truncatedTopN": true
}
The content text renders the reference cos_loc_counter.sh ASCII metrics table (or its CSV rows with format: "csv").
Input:
{}
Output:
{
"version": "IRIS for Windows (x86-64) 2024.1",
"platform": "Windows",
"instanceName": "IRIS"
}
Input:
{
"namespace": "USER"
}
Output:
{
"name": "USER",
"routineDB": "USER",
"globalsDB": "USER"
}
Input:
{
"global": "MyData",
"subscripts": "\"key1\""
}
Output:
{
"value": "Hello World",
"defined": true
}
Input:
{
"global": "MyData",
"subscripts": "\"key1\"",
"value": "New Value"
}
Output:
{
"value": "New Value",
"verified": true
}
Input:
{
"global": "TempData"
}
Output:
{
"deleted": true,
"global": "TempData"
}
Input (case-insensitive filter — default):
{
"filter": "my"
}
Output:
{
"globals": ["MyData", "MyConfig", "MyTemp"],
"count": 3
}
The filter is applied client-side as a case-insensitive substring match by default, matching iris_doc_list semantics. A filter of "my" matches "MyData", "MYAPP", and "mytemp".
Pass caseSensitive: true to restore the old case-sensitive (exact substring) behavior.
subscripts contract and security note (Story 36.4): subscripts is always treated as literal
DATA, never as code. The rules:
- The string is split on every comma — a string key that itself contains a comma is not supported. Leading/trailing whitespace around each piece (space, tab, non-breaking space) is trimmed.
- A canonical number (
1,-1.5) is a numeric subscript. Anything else is a string subscript. - Wrap a string key in quotes (
'"key1","key2"') and double any quote inside it ('"a""b"'addresses the single subscripta"b). Quotes,_,$,@,(,),^,|and control characters inside a key are stored and addressed as that literal text — nothing in a subscript is ever executed. - A piece that begins or ends with an unmatched quote — which is what a quoted key containing a
comma turns into after the split, e.g.
'"a,b"'— is rejected with a clear error instead of silently addressing a different node.
Before Story 36.4, a quote inside a string subscript could close the literal and the rest of the
value ran as ObjectScript — reachable through iris_global_get (a read-classified, default-enabled
tool) even under IRIS_GOVERNANCE_PRESET=read-only. This is fixed; see the CHANGELOG ### Security
entry.
Input:
{
"command": "Write \"Hello from IRIS\""
}
Output:
{
"output": "Hello from IRIS",
"truncated": false
}
output is capped at 32768 RAW characters (Story 34.6 AC 34.6.1; the ceiling bounds
raw content, not the serialized wire size — see below) — content beyond the ceiling is cut
off and replaced with a structured, machine-detectable marker
([IRIS-MCP-TRUNCATED ceiling=32768chars]), never a bare .... This ceiling bounds the
response payload only: the command has already fully executed by the time it is applied,
so it is not protection against the command's own execution time or resource usage, and it
is not a Web Gateway timeout safeguard (Rule #38) — live measurement found the CSP
Gateway/HTTP transport tolerates multi-megabyte responses cleanly (tested clean to
3,000,000 characters). The 32768 value was chosen because a real MCP client (Claude Code
CLI) was observed diverting a rendered tool result away from inline consumption once it
reached 50,031 characters — 32768 stays safely under that measured boundary.
Raw characters vs. serialized JSON size (Story 34.7, AC 34.7.4). The 32768 figure is
measured via $Length on the raw content before JSON string escaping — it is not a
promise about the HTTP response body's own byte size. Quotes, backslashes, and control
characters each expand under JSON escaping (a quote or backslash becomes a 2-character
escape; a control character with no short escape becomes a 6-character \uXXXX escape),
so metacharacter-heavy output can serialize to several times the raw-character ceiling.
Live-measured inflation, each row a single field holding exactly 32768 raw characters
(so the raw ceiling is honored identically in all three):
| content | serialized HTTP body | inflation |
|---|---|---|
| escaping-neutral plain letters | 32,860 | 1.0x |
| mixed metacharacters (quote, backslash, tab, one control char) | 98,311 | 3.0x |
worst case — all C0 control characters (\uXXXX, 6 chars each) |
196,495 | 6.0x |
Honest residual risk: the worst case is about 6x the raw ceiling — roughly 3.9x
past the 50,031-character client-divert threshold cited above, which was the entire
rationale for the 32768 figure. The shared budget substantially reduces the pre-34.7 worst
case (which was this same inflation again per independent field) but does not restore
that safety margin for metacharacter-heavy content. Tracked as 34-7-QA-1 in
deferred-work.md.
truncated is true whenever output does not contain everything the command wrote,
whether because it hit the 32768-character ceiling above or the platform's long-string
ceiling mid-command — the call still succeeds, with whatever was captured up to that
point, and this is never silent. On a FAILED call the tool reports the error text
as usual, and additionally surfaces truncated in the response's structuredContent
(e.g. {"truncated": false} alongside "isError": true) whenever the underlying REST
error envelope carried the flag — verified live against the real /command endpoint
(Story 34.5). structuredContent is omitted entirely, not set to false, on any IRIS
error whose response envelope never carried the flag — a request rejected before the
server's capture logic began, or a server predating Story 34.4. (A transport-level
failure such as a refused connection is a different case again: it raises a connection
error rather than producing a tool error response at all.)
Each args entry is either a plain scalar (by value) or a {"byRef": true, "value"?: ...}
marker for a ByRef/Output parameter — up to 20 positions total. Any Write output the
target produces is captured (no wrapper class needed for narrating methods, stock runners
like %UnitTest.Manager.RunTest, or targets that switch namespace mid-call) and returned
in output; argCount is unchanged from prior versions of this tool. Omitting args and
passing [] are the same zero-argument call.
Capture caveat (ledger 34-3-R3 / 34-1-R13, a documented limitation). The capture
lives in the process-private variables %ExecuteMCPOutput/%ExecuteMCPTruncated, so a
target that KILLs them — an argumentless KILL, or a unit-test class whose setup/teardown
clears them — silently loses everything captured before that point, and truncated does
not report it. Run unit-test suites with iris_execute_tests rather than through this tool.
Response payload budget (Story 34.6 AC 34.6.1, revised by Story 34.7 AC 34.7.3 — ledger
34-6-CR2-6). returnValue, byRefValues, and output share ONE 32768-RAW-character
response budget — not three independent 32768 budgets — spent in this field order:
returnValue first (the method's actual result, usually small, so it is never starved by
narration), then byRefValues, then output last (narration is usually the field that
actually exceeds the budget, so it usually absorbs the truncation). Whatever a field does
not use is available to the next one: a small returnValue leaves nearly the whole 32768
for byRefValues/output, while a returnValue alone longer than 32768 characters
consumes the entire budget, leaving nothing for the other two. Truncated content is cut
off and replaced with a structured, machine-detectable elision marker
([IRIS-MCP-TRUNCATED ceiling=<N>chars], where <N> is however much of the shared budget
remained for that field at that point — not always 32768), never a bare .... Flagged via
returnValueTruncated (for returnValue), truncated (for output), and byRefTruncated
(for byRefValues) — three separate booleans, retained from the pre-34.7 shape, since each
describes a different response field.
byRefValues (marked positions' post-call values, keyed by zero-based index) is
additionally bounded by its own 1000-node structural ceiling, independent of (and on
top of) the shared character budget above. The shared budget is charged for every piece of
byRefValues content emitted — leaf values, <Object:...> placeholders, and subscript keys
— but not for the per-node JSON scaffolding, which the 1000-node ceiling bounds instead.
Once either budget is exhausted, further subscript entries are omitted from the affected
node (marked subscriptsTruncated: true), and a marked position reached after the shared
budget is already gone is omitted from byRefValues entirely. A position reached with
budget still remaining, but whose value does not fit in what remains, is cut short in one of
two ways: with the elision marker described above when there is room for the marker itself,
or — when the remaining budget is smaller than the marker (under ~40 characters) — as a
plain unmarked prefix of the real value, since emitting the marker there would replace a
value with something larger than itself (Story 34.6 code-review finding CR-6). In that last
case byRefTruncated is the only signal — the value carries no marker of its own, so
the absence of a marker is not proof that a byRef value is complete.
Raw characters vs. serialized JSON size (Story 34.7, AC 34.7.4). The 32768 figure is
measured via $Length on each field's raw content before JSON string escaping — it is
not a promise about the HTTP response body's own byte size. Quotes, backslashes, and
control characters each expand under JSON escaping (a quote or backslash becomes a
2-character escape; a control character with no short escape becomes a 6-character \uXXXX
escape), so metacharacter-heavy content can serialize to several times the raw-character
budget. Live-measured worst case: a single 32768-raw-character field of C0 control
characters (consuming the ENTIRE shared budget by itself) serialized to a
196,495-character HTTP response body — 6.0x the raw ceiling. See the measurement table
under iris_execute_command above for the full escaping-neutral / mixed / worst-case
range. This supersedes the earlier, now-inapplicable per-field measurement ("two
32768-character fields serializing to 131,102 characters"), which described the pre-34.7
independent-budget shape. Honest residual risk: 196,495 is roughly 3.9x past the
50,031-character client-divert threshold documented under iris_execute_command above,
which was the entire rationale for the 32768 figure — the shared budget reduces but does
not eliminate the risk that a metacharacter-heavy response gets diverted away from inline
consumption by an MCP client. Tracked as 34-7-QA-1 in deferred-work.md.
Truncated output is not always marked. Because output is spent last, it can be
left a remainder smaller than the elision marker itself (~37-41 characters). In that band
output is a plain hard-cut prefix with no [IRIS-MCP-TRUNCATED …] marker at all —
exactly the fallback described for byRefValues below. As there, truncated: true is then
the only signal, so the absence of a marker is not proof that output is complete.
None of these ceilings are protection against the
target's own execution time, resource usage, or a Web Gateway timeout — the target has
already fully run by the time these caps are applied to the response payload. On a FAILED
call the tool reports the error text as usual, and additionally surfaces truncated in the
response's structuredContent whenever the underlying REST error envelope carried the
flag — same mechanism as iris_execute_command above (Story 34.5).
Input (plain scalars):
{
"className": "MyApp.Utils",
"methodName": "Add",
"args": [3, 4]
}
Output:
{
"returnValue": "7",
"argCount": 2,
"output": "",
"byRefValues": {},
"truncated": false,
"byRefTruncated": false,
"returnValueTruncated": false
}
Input (an Output parameter via a byRef marker):
{
"className": "MyApp.Utils",
"methodName": "Summarize",
"args": [{ "byRef": true }]
}
Output:
{
"returnValue": "ok",
"argCount": 1,
"output": "",
"byRefValues": { "0": "summary text" },
"truncated": false,
"byRefTruncated": false,
"returnValueTruncated": false
}
Input:
{
"target": "MyApp.Tests",
"level": "package"
}
Output:
{
"total": 5,
"passed": 4,
"failed": 1,
"skipped": 0,
"details": [
{ "class": "MyApp.Tests.UtilsTest", "method": "TestAdd", "status": "passed", "duration": 12, "message": "" },
{ "class": "MyApp.Tests.UtilsTest", "method": "TestBadInput", "status": "failed", "duration": 8, "message": "Expected 0, got 1" }
]
}
A run that matches zero test methods at any level — a typo'd class or method name, or a
class:method spec the runner doesn't match — returns an explicit error field naming
the target and level instead of a silent total: 0, passed: 0, failed: 0
(Story 34.5). This response carries both isError: true and structuredContent
set to the same object shown in the text content (Story 34.6, AC 34.6.4 — a recorded
Project Lead decision: the guard fires only when the target produced nothing, a failed
request rather than a clean run, so isError is truthful; carrying structuredContent
keeps structuredContent.total reading 0 with a populated error rather than
regressing to undefined for structured consumers). Applied identically to every guard
path — package/class/method levels and the package discovery-time check:
{
"total": 0,
"passed": 0,
"failed": 0,
"skipped": 0,
"details": [],
"error": "No tests found for 'MyApp.Tests.UtilsTest:TestTypo' at level 'method'"
}
If the runner instead reports that the target was found but the run failed before any
test method could execute — a setup failure such as an OnBeforeAllTests error — the
error field carries that reason rather than the generic "not found" wording, so a
broken fixture is never misreported as a misspelled target (same isError/
structuredContent shape as above):
{
"total": 0,
"passed": 0,
"failed": 0,
"skipped": 0,
"details": [],
"error": "Test run for 'MyApp.Tests.UtilsTest' at level 'class' produced no method-level results — MyApp.Tests.UtilsTest: OnBeforeAllTests: ERROR #5001: ..."
}
At level: "method", use the method's real, Test-prefixed name (e.g.
MyApp.Tests.UtilsTest:TestAdd) — the same form shown in details[].method
above. Internally the tool strips that prefix before querying IRIS's Atelier
test-runner endpoint (which matches on the unprefixed form) and restores it on
every result row, so the documented prefixed form is what you should always
pass and always see back; you do not need to do this stripping yourself.
A completed run's structuredContent additionally carries status: "completed",
jobId, runIndex, and runIndexSource — Story 36.1, so a caller can
correlate results by handle instead of guessing at MAX(InstanceIndex).
runIndexSource is "queue" (read from the job's own
IRIS.TempAtelierAsyncQueue(<jobId>,"unittest","id") node on a still-running
poll) or "counter" (a run that finished before that node could be read: the
^UnitTest.Result counter read just before queueing vs. after completion moved
by exactly 1, and the run drained result rows). Otherwise both are null and a
runIndexNote says why (e.g. a concurrent run also allocated an index). Existing
fields (total/passed/failed/skipped/details) are unchanged.
Long-running suites: timeout and the "still running" result (Story 36.1)
The tool waits up to 120 seconds by default before it stops blocking — override
per call with timeout (a positive number of seconds; hard-capped at 3600s,
a larger value is silently clamped and the response carries timeoutCapped: true)
or set IRIS_TEST_TIMEOUT as an environment-level default (precedence:
timeout argument > IRIS_TEST_TIMEOUT > the 120s default). MCP clients
impose their own tools/call ceiling independently of this budget — the MCP
TypeScript SDK defaults to 60 seconds, and several clients cap at 60s-2min (not
always configurable) — so a long timeout value is a convenience, not a
guarantee that the CLIENT will wait that long.
If the wait budget expires while the ObjectScript run is still executing server-side, the tool returns a non-error result instead of a timeout error:
{
"status": "running",
"jobId": "31797604",
"runIndex": 256,
"runIndexSource": "queue",
"elapsedMs": 120204,
"timeoutMs": 120000,
"target": "MyApp.Tests.SlowSuite",
"level": "class",
"namespace": "HSCUSTOM",
"partial": { "total": 2, "passed": 2, "failed": 0, "skipped": 0, "details": [] },
"hint": "Still executing server-side. Do NOT re-submit. ..."
}
isError is false — the request succeeded; the run was submitted and is
executing. This is not a failure and not a final result — do NOT re-submit
the same target, which starts a SECOND concurrent run against shared test
fixtures. partial is the drained-so-far subset ONLY (never a top-level
total a consumer could mistake for a final count). Counts under partial
can go up on a later look, never down. On a running result runIndexSource is
"queue" or null — the counter fallback is never applied while a run is
still executing (another client's run could be counted instead); a null
index carries a runIndexNote. If polling an already-queued job fails
(an HTTP error or a network timeout), the error result still carries the
jobId, the drained-so-far partial rows and the same re-attach hint.
To see the run through, re-attach rather than re-submit — the response's hint
carries the exact calls:
-
Today, in every preset: the
runIndex(the response's own, oriris_global_getwith globalIRIS.TempAtelierAsyncQueueand subscripts<jobId>,"unittest","id"while the job is queued or running), theniris_sql_query(a read tool, so it also runs under the read-only preset):SELECT ti.DateTime AS FinishedAt, tc.Name AS ClassName, tm.Name AS MethodName, tm.Status, tm.Duration, tm.ErrorDescription FROM %UnitTest_Result.TestMethod tm JOIN %UnitTest_Result.TestCase tc ON tm.TestCase = tc.ID JOIN %UnitTest_Result.TestSuite ts ON tc.TestSuite = ts.ID JOIN %UnitTest_Result.TestInstance ti ON ts.TestInstance = ti.ID WHERE ti.InstanceIndex = ? -- parameters: [runIndex]Only
%UnitTest_Result.TestInstancehas anInstanceIndexcolumn — the other result tables join down to it. NeverMAX(InstanceIndex), which can pick up a different, concurrently-started run. These rows exist while the run is still executing (a method still running already readsStatus1), so treat them as final only onceFinishedAtis non-empty. -
Easier —
iris_test_status(Story 36.2, enabled by default): call it withaction: "poll"and the samejobId(and/orrunIndex) and the run's ownnamespace(the Atelier queue is instance-wide but%UnitTest_Resultis per-namespace, so it must match) — it builds the SAMErunning/completedshapes shown above, but sourced authoritatively from%UnitTest_Resultby exactInstanceIndexonce finished (never from a single drain alone). See its own detail block below.
Concurrency caveat: two runs of the SAME class started close together
share that class's fixtures, and the Atelier endpoint predicts a run's
index (reading the counter) slightly before %UnitTest.Manager actually
allocates it — a race between near-simultaneous submissions can misattribute
a run's own index. Avoid submitting the same target concurrently.
Method-level target validation (Story 36.1): at level: "method", the
ClassName:MethodName target is trimmed and validated — more than one :
separator, or an empty class segment before :, returns an explicit
malformed-target error (distinct from the zero-result guard) instead of
silently discarding part of the target or querying an empty class name. So
does a method segment that holds ;, , or ^ (Story 40.3): the work queue
writes it into %UnitTest.Manager's test spec, which reads ; as more
classes, , as more specs and ^ as setup code to run, so the run would
include classes the TestProduction guard never inspected, or code that is
not a test. Nothing is asked or queued. If
the method name you typed doesn't match what actually ran (the endpoint's
Test-prefix-stripped filter is many-to-one — Class:Validate and
Class:TestValidate both resolve to the same wire filter), the response
carries an additive methodMismatchWarning field naming the mismatch rather
than staying silent about it.
TestProduction guard (Story 40.3)
%UnitTest.TestProduction tests start a production, and before they do, it stops any production in the namespace that is
not stopped (and, when that one will not stop, force-stops and cleans it). On a shared instance that would silently stop
someone else's production while the tool reported "passed". So a run that includes a %UnitTest.TestProduction test, at
package, class or method level (a method-level run of such a class is guarded whatever the method), is decided on the IRIS
side before anything is queued:
- the run goes ahead when the namespace's production is stopped, or is one of the productions the run's TestProduction
tests declare as their own (their
PRODUCTIONparameter); - otherwise it is refused with
isError: true,code: "PRODUCTION_BUSY": any other production in any state, or a state that cannot be read (Ens's production lifecycle lock could not be taken within 5 seconds). Nothing is queued, no test runs, and that production is left untouched.
{ "code": "PRODUCTION_BUSY", "namespace": "MYAPP", "state": "Running",
"testProductions": [ { "class": "MyApp.Tests.OrderFlowTest", "production": "MyApp.OrderProduction" } ],
"production": "Other.Production" }
production is the running production (present when the state was read); when it could not be read, state is "Unknown"
and error says why instead. The text names the production and says it was left untouched. A run with no TestProduction test
is unaffected: it never reads Ens state and its result is byte-identical to before. The tool stays enabled by default and no
governance key is added; the guard has no switch.
What to do: run the tests once the other production has stopped. If an interrupted run of a TestProduction test left its
production running (a test that raised an error in its own hook leaves it running, and so does a killed or cancelled test
process), stop it with iris_production_control and run the tests again. The suite never stops a production itself: Ens
keeps no record of who started one, so a leftover cannot be told from a production someone started on purpose.
Limits, stated plainly. The guard needs the ExecuteMCPv2 service at the version that ships it; against a server whose service
lacks it (the guard route answers 404) the run goes ahead unguarded, as before. So does a run in a namespace that cannot see the
ExecuteMCPv2 package (no %ALL package mapping, as after a manual setup): the guard cannot run there. So does a run in a
namespace that holds its own copy of an earlier build of the package, one without ExecuteMCPv2.REST.UnitTest:ProductionGuard.
The decision is taken under Ens's own lifecycle lock, but %UnitTest.TestProduction starts its production later, in the test
process, so a production started by another process in between would still be stopped. A production that is already running under a name one
of the run's tests declares is treated as that run's own and is stopped by the run, whoever started it: by its own test, which
restarts it for the test, or by another TestProduction test of the same run. One that does not stop within the test's MAXWAIT
is force-stopped and cleaned with CleanProduction(1), which also deletes its persistent application data, and the run leaves it
Stopped, so a developer's own run of that production, or a concurrent run of the same test, is not protected. A guard read that
fails for any reason other than a 404 ends the call before anything is queued (an HTTP 5xx or 403 with the usual
Error executing tests result, a connection error with the server's own tool error), even for a run with no TestProduction
test. A class that is neither compiled nor defined is not a TestProduction test. Privileges
were verified under _SYSTEM only; a lower-privileged account gets IRIS's own error text. Earliest IRIS version verified:
2026.2 build 221U.
Companion to iris_execute_tests: use it after that tool returns
status: "running" (or after your own client abandoned a long call) instead
of re-submitting the same target — re-submitting starts a SECOND concurrent
run against shared fixtures. With a coverageRunId instead of jobId or
runIndex it is the companion of iris_test_coverage too.
Defaults at a glance (Story 40.4). One governance key per action:
iris_test_status:poll is a read and enabled by default;
iris_test_status:cancel and iris_test_status:export are writes and
DEFAULT-DISABLED. Enable them with
IRIS_GOVERNANCE={"global":{"iris_test_status:cancel":true,"iris_test_status:export":true}}.
action: "poll" (read, enabled by default) — Input:
{ "jobId": "31797604", "namespace": "HSCUSTOM" }
jobId is the all-digits Atelier work-queue id iris_execute_tests returned —
anything else is refused before any IRIS call, as is a jobId whose queue
entry is not a unit-test job (a poll would otherwise drain another client's
result). Pass the run's own namespace (the one iris_execute_tests
reported): the Atelier work queue is instance-wide, but %UnitTest_Result is
per-namespace, so a different namespace reads a different run.
or, once the job is no longer known to Atelier (already consumed, or stale):
{ "runIndex": 256 }
Output while still running (identical shape to iris_execute_tests'
own running result, partial being the DELTA this ONE poll drained —
never cumulative across separate calls):
{ "status": "running", "jobId": "31797604", "runIndex": 256, "runIndexSource": "queue",
"partial": { "total": 0, "passed": 0, "failed": 0, "skipped": 0, "details": [] },
"hint": "..." }
Output once finished — built AUTHORITATIVELY from %UnitTest_Result by
exact InstanceIndex (runIndexSource: "result-table"), never from a single
drain alone (an earlier iris_execute_tests "running" response may already
have drained some rows, which never reappear). Every details row is
value-identical to what iris_execute_tests itself returns for the same run —
millisecond duration, drain order, and message including a method-level
error such as a thrown exception:
{ "total": 1, "passed": 1, "failed": 0, "skipped": 0,
"details": [{ "class": "MyApp.Tests.SlowSuite", "method": "TestSlow", "status": "passed", "duration": 10009.4, "message": "" }],
"status": "completed", "jobId": "31797604", "runIndex": 256, "runIndexSource": "result-table" }
A finished run that recorded NO method-level results (e.g. a failed
OnBeforeAllTests) returns the same isError: true zero-result guard
iris_execute_tests returns (top-level zeros + an error naming the
class-level reason) — never a green completed with total: 0. If Atelier
reports the job finished but no run index could be captured at all (the
/global route unavailable), the rows that poll drained come back under
partial of an isError: true result — they may be missing rows an earlier
call drained, so they are never presented as a final count; pass runIndex
for the authoritative result.
runIndex alone reads %UnitTest_Result directly: status: "completed"
(SQL path, as above) once TestInstance.DateTime is set, or
status: "unfinished" when it is not — the result table alone CANNOT tell a
still-running job from a cancelled/crashed one (a cancelled run's row never
finishes), so an unfinished result carries interim rows only under
partial (each labelled "in-progress", never counted as a pass) and
recommends polling by jobId for an authoritative answer:
{ "status": "unfinished", "runIndex": 61, "runIndexSource": "result-table",
"partial": { "total": 0, "passed": 0, "failed": 0, "skipped": 0,
"details": [{ "class": "MyApp.Tests.SlowSuite", "method": "TestSlow", "status": "in-progress", "duration": 0, "message": "Row not final — this method has not finished executing yet." }] },
"note": "The result table shows InstanceIndex 61 has not finished. ..." }
A jobId Atelier no longer recognizes (HTTP 404 — already consumed by an
earlier poll/cancel, or stale) falls back to runIndex when supplied, else
reports a clear not-found result naming that fallback. A jobId whose queue
node is gone AND whose runIndex shows unfinished is reported
status: "abandoned" — no live Atelier job references it any longer
(cancelled, crashed, or its worker died).
action: "cancel" (write, DEFAULT-DISABLED — enable via IRIS_GOVERNANCE,
e.g. {"global":{"iris_test_status:cancel":true}}) — Input:
{ "jobId": "31797604" }
Stops a RUNNING job (DELETE /work/{jobId}) and reports the OBSERVED
outcome, never an assumed one — the queue entry is re-read after the
DELETE, and the result row is reported as found (unfinished, or absent
when the run never started):
{ "status": "cancelled", "jobId": "31797604", "runIndex": 256,
"observed": { "queueNode": "gone", "resultRow": "unfinished — TestInstance 256 has no finish time right after the DELETE; a run whose worker was stopped never finalizes (poll by runIndex 256 later to confirm it stays unfinished)" } }
A DELETE that itself fails (e.g. HTTP 423 while another caller holds the
job's lock) returns isError: true with the jobId/runIndex kept and a
note that whether it took effect is unknown — poll before retrying.
Cancelling a job that had ALREADY finished but was never drained discards
only the queue entry — the results are preserved and returned:
{ "total": 1, "passed": 1, "failed": 0, "skipped": 0, "details": [ /* ... */ ],
"status": "completed", "jobId": "31797604", "runIndex": 256, "runIndexSource": "result-table",
"note": "The job had already finished; cancelling discarded only its queue entry. Results are preserved — poll by runIndex 256." }
cancel requires jobId — there is no way to cancel by runIndex alone (the
Atelier work-queue DELETE route operates on the job id).
action: "export" (write, DEFAULT-DISABLED — enable via IRIS_GOVERNANCE,
e.g. {"global":{"iris_test_status:export":true}}) — Input (Story 40.2):
{ "action": "export", "coverageRunId": "645", "outputPath": "/work/ci/coverage.xml", "sourceRoot": "src" }
Writes a coverage run's Cobertura XML (the format CI tools such as GitLab and Jenkins read) to outputPath, and returns the
poll result of that run plus cobertura: {outputPath, bytes, classes, lines} and one text line,
Cobertura XML written to <path> (<bytes> bytes). coverageRunId and outputPath are required; outputPath must be absolute,
contain no .. segment and end in .xml (any letter case), or the call is an error and nothing is sent to IRIS and nothing is
written. The parent directories are created, the file is written to a temporary sibling and renamed over outputPath, and an
existing file is overwritten. sourceRoot is the document's one <source> element (a directory CI tools resolve each class
filename against); without it the document has no <sources>. jobId or runIndex together with the handle, and
outputPath or sourceRoot with poll or cancel, are validation errors. Only a completed run with complete coverage, at
least one test run and a class-source map can be exported: for any other run (still running, cancelled, failed, abandoned) the
result is isError: true, names the status, and nothing is written (a run that is still starting or running is told to wait
for it with poll; a finished one, to run the tests again). A completed run in which no class has a class-source result
(every class is not-up-to-date, not-compiled or unavailable, or the instance returned an empty class-source map) is refused
too, with isError: true and the advice to recompile the classes (a forced compile when only comments changed) and run the tests again: a file with no lines would read to a CI
tool as 100% covered. For the same reason, so is a completed run in which no class has an executable class line (for example,
every listed class has only method generators, non-ObjectScript methods or methods that compile to no INT code). CI tools lay the reported line numbers over your repository's own .cls files, so those files must be
in the layout IRIS stores (for example as iris_doc_export writes them), or the numbers can be offset. The document is
deterministic for a run: the timestamp is
the run's finishedAt in epoch milliseconds, each filename is the path iris_doc_export writes the class to (for example
Story402/Fixture.cls), a <package> is written per class package, a <class> per measured class with a class-source result,
a <method> (without complexity, which the published DTD does not declare) per mapped method with an executable class line,
and one <line number hits/> per executable class line; branch rates and complexity are 0 because branches are not measured, and
generated INT lines and unmeasured classes are left out. It validates against the published coverage-04.dtd.
Runs the tests of target while an IRIS Line-by-Line session measures the INT routines of the listed classes
(1 to 50 class names, no wildcards), then reports coverage per routine. DEFAULT-DISABLED (enable it with
IRIS_GOVERNANCE={"global":{"iris_test_coverage":true}}); the wait budget is timeout, or IRIS_TEST_TIMEOUT,
or 120 s (capped at 3600 s, with timeoutCapped: true when clamped).
Defaults at a glance (Story 40.4).
| Key | Class | Default state |
|---|---|---|
iris_test_coverage |
write | DEFAULT-DISABLED (it starts an instance-wide monitor and runs test code) |
iris_test_status:poll |
read | enabled |
iris_test_status:cancel |
write | DEFAULT-DISABLED |
iris_test_status:export |
write | DEFAULT-DISABLED (it writes a local file) |
iris_execute_tests is classified write and enabled by default (a key of the frozen baseline). minCoverage omitted means no
verdict: the result then carries no coverage.verdict and no Coverage target line. The developer preset shows
iris_test_coverage and iris_test_status; the core preset hides both, and a hidden tool cannot be called. One setting enables
the three disabled keys:
IRIS_GOVERNANCE={"global":{"iris_test_coverage":true,"iris_test_status:cancel":true,"iris_test_status:export":true}}.
The deploy-and-test-class prompt offers a coverage step and copes with a hidden or disabled tool.
Input:
{ "target": "MyApp.Tests.OrderTest", "level": "class", "classes": ["MyApp.Order", "MyApp.OrderLine"], "namespace": "MYAPP" }
Result: the test summary (total, passed, failed, skipped, details) with status: "completed", the handles
(coverageRunId, runIndex, pid, runnerPid), and coverage:
{ "complete": true,
"classes": [ { "class": "MyApp.Order", "routines": [ { "routine": "MyApp.Order.1", "lines": 48, "executableLines": 28,
"coveredLines": 20, "percent": 71.43, "executableRanges": [[6,10],[12,12] /* ... */], "coveredRanges": [[6,7],[9,10] /* ... */] } ] } ],
"unmeasured": [ { "class": "MyApp.Missing", "reason": "not-compiled" } ] }
The text form is compact: MyApp.Order.1: 20 of 28 executable INT lines covered (71.43%); uncovered 8, 16-18, 23, 27, 47-48,
then Not measured: MyApp.Missing (not-compiled). unmeasured reasons are not-compiled, no-routines (the class compiled
no routine, as for a class with no method) and no-int-source (a routine kept no INT source, as for a system class).
What is measured. INT lines of the listed classes' routines (<Class>.1 to <Class>.N; the .0 method-generator
routine is never measured), counted as executable by a fixed rule: a label's methodimpl/public/private keyword, Try,
Catch, Else and Do { lines never count, ElseIf does. A method that compiles to no INT code has no line to cover.
The code the compiler generates in a routine (property accessors, embedded-SQL helpers) is part of its INT lines.
The line numbers are INT line numbers: INT line n is line n+1 of the document iris_doc_get returns for
<routine>.int (for example MyApp.Order.1.int) and of the text iris_routine_intermediate returns, because their
line 1 is the ROUTINE <name> [Type=INT,Generated] header.
Only the process that runs the tests is measured (and the suite's own supervisor process, which runs only the suite's
own ExecuteMCPv2 classes, so they count only if you list them), so code that runs in processes the tests start is not
counted. The run refuses more than 200,000 measured INT lines.
One run at a time, instance-wide. The monitor is one per instance, shared with every other user of it. While any
Line-by-Line or PERFMON session is running, a call is refused with isError: true and code: "MONITOR_BUSY", owner: "suite" (a coverage run is active: the refusal carries its coverageRunId, pid, startedAt and namespace) or
owner: "foreign" (a session this suite did not start; it is never touched). Nothing is started in either case.
TestProduction guard (Story 40.3). %UnitTest.TestProduction stops any production in the namespace that is not stopped
before it starts its own. So a coverage run of a %UnitTest.TestProduction test asks the same IRIS-side guard as
iris_execute_tests, before it allocates a run id (only the compiled test classes are asked, because the runner never
compiles, and they are the classes the runner will run: every class of a package, judged by its compiled class, and the target
itself when a package-level target holds no test class, because the runner then runs it as a class): while a production other
than the tests' own runs in the namespace, or its state cannot be read, the call is
refused with isError: true and code: "PRODUCTION_BUSY" (namespace, state, testProductions, and production or
error). No run id is allocated, nothing is written and no monitor session is started, and that production is left
untouched. With no other production running the run completes as before and leaves its own production stopped. A target
whose package or class part (before the first :) is empty or blank, such as : or :TestSomething, is rejected before
anything starts, by the tool's schema and by the service: the runner would read it as every compiled test class under
^UnitTestRoot, which the guard cannot check. In a namespace where the guard cannot run (the ExecuteMCPv2 classes are not
visible there, or it holds its own copy of an earlier build) iris_test_coverage is refused with an error and nothing is
started, where iris_execute_tests goes ahead unguarded. See the iris_execute_tests entry for the fields, the recovery and
the other limits.
Budget expiry and re-attach. A run that outlives the wait budget returns isError: false, status: "running" and its
handles; do NOT re-submit. Call iris_test_status with action: "poll" and coverageRunId (the run's own namespace is
used) for the same result once the run is finished, or action: "cancel" to stop it; that is its own key,
iris_test_status:cancel, DEFAULT-DISABLED (enable it with {"global":{"iris_test_status:cancel":true}}). A cancelled or killed
run reports the partial counts it reached with coverage.complete: false. A handle is kept for the 20 most recent runs and
does not survive an instance restart. A run is bounded by a server-side limit of 3600 s.
A run that loses its counts or its release is never silent. If the run's line counts could not be read, the run ends
status: "failed" with reason: "counts-unreadable", IRIS's text in error and readError, and the test summary. If its
Line-by-Line session could not be stopped, it ends status: "failed" with reason: "release-failed", the test summary and
any coverage that was read (none when a release lock, the run's own or the monitor's, could not be taken in time, because
nothing is read from a session that was not locked for its release, and readError then says why the counts were not
read); the suite-owned session stays active, and the next coverage run reclaims it. Both
are isError: true. The test process and its supervisor release the session one at a time, each only after proving the
session is the run's own.
Class names are matched exactly as compiled, with the package and the letter case (MyApp.Orders); a name that is not
compiled under that spelling is reported under unmeasured as not-compiled.
Earliest IRIS version verified: IRIS 2026.2 build 221U (%Monitor.System.LineByLine, the %UnitTest.Manager hooks and
%Library.SyntaxColorReader).
Coverage of the class source (Story 40.2). Beside the per-routine INT lines, every completed result reports coverage over the
lines of the class source you edit: coverage.classes[i].source is
{ "executableLines": 23, "coveredLines": 22, "percent": 95.65,
"executableRanges": [[13,14],[19,19] /* ... */], "coveredRanges": [[13,14] /* ... */], "uncoveredRanges": [[31,31]],
"methods": [ { "method": "Macro", "line": 28, "executableLines": 5, "coveredLines": 4, "percent": 80, "uncoveredRanges": [[31,31]] },
{ "method": "Generated", "line": 59, "executableLines": 0, "coveredLines": 0, "percent": null, "uncoveredRanges": [], "reason": "generator" } /* ... */ ],
"generated": { "executableLines": 23, "coveredLines": 11 } }
and coverage.source is the total over the classes that have such a result. A class line is executable when its INT line is
(the 40.1 rule, unchanged) and covered when that INT line ran. Only the body lines of the methods a class defines count: a
#define line, a continuation line of a multi-line statement, a lone } and a comment line are never executable. A method has
a reason and no lines when it is a method generator (generator), is not written in ObjectScript (not-objectscript, a
Language set on the method or on the class), or is not laid out where IRIS stores it (layout); a method that compiles to no
INT code (a constant return, for example) has no lines either, and no reason. A method's lines are the body lines that map
after its own INT label line, and a preprocessor line (#dim that initializes nothing, #define, #sqlcompile and the like) is never a class line: the compiler maps a leading
one onto the code of the method before it or onto the method's own first statements. A #dim that initializes its variable
(it holds an = outside parentheses, string literals and comments, as in #dim tSC As %Status = $$$OK) is the exception: it compiles to a
Set at its own INT line, so it is an executable class line (Story 40.4). An = in a trailing //, ; or /* */ comment initializes
nothing. A statement that spans several lines but compiles to one INT line is reported once, at the first line that maps
to its code. For a multi-line embedded SQL statement that is the line after the &sql( line (the &sql( line maps to a comment
line of the INT routine, and the other continuation lines are not executable); a single-line &sql(...) statement is reported at
its own line. A class without a result has source: {reason}, and the reason is one of three:
not-up-to-date (its definition changed after it was compiled, or its compiled line map is gone: a documentation-only edit saved
after the compile leaves IRIS calling the class up to date, a default compile skips it, and only a forced compile, flags ck,
rebuilds the map), not-compiled (it has no compiled definition at the end of the
run) or unavailable (its map could not be built). The code the compiler generates in the class (property accessors, embedded-SQL helpers) is counted per class
in generated and never reported as source lines. The text form adds, after the status line, one line per class and one
indented line per method with an uncovered line:
Story402.Fixture: 22 of 23 class lines covered (95.65%); uncovered 31 then Macro: 4 of 5 (80%); uncovered 31.
Class line numbers are those of the class document iris_doc_get returns for <class>.cls, which IRIS stores in its own
layout (one blank line between members, each signature on one line, a blank line after the class {); a file uploaded in
another layout can number its lines differently, so read the class with iris_doc_get before comparing. The per-routine INT
fields of each result are exactly what Story 40.1 returned.
Stale classes and label lines (Story 40.4). The IRIS side reports, per class, whether the class still has the line map its
compile wrote (lineMap in the run's Status record: 10, or 0 once a documentation-only save removed it), and, per method, the INT
line of its compiled label (labelLine, read from the method's own RtnLabel, so it is exact when two method names share their
first 31 characters). A class is not-up-to-date exactly when its lineMap is 0 while some method that compiled to INT code has a
label line; a class whose methods hold only preprocessor lines and has its line map is not (it has no executable class line and the
verdict notApplicable), and neither is a class whose methods all compile to no INT code. A record stored without lineMap (by
an older service build) is judged by its shape as before. A class compiled without a debug line map, if a compile qualifier allows
one, would read not-up-to-date: a false FAIL, never a false PASS; one probe of a newly created class found no line map right
after its compile, once, and about 30 later runs did not repeat it (a forced compile, flags ck, rebuilds the map). A method whose
name begins with a percent sign (%OnNew, for example) has an empty RtnLabel when its label is its name cut to 31 characters, and
that label is its label line, so a stale class of such methods is not-up-to-date too. Earliest IRIS version verified: 2026.2 build
221U.
minCoverage and the verdict (Story 40.2). An optional number from 0 to 100 stored with the run. A completed result then
carries coverage.verdict ({minCoverage, overall, percent, classes:[{class, verdict, percent, reason?}]}) and the text line
Coverage target 90%: FAIL (88.89% overall); failing: Story402.Layout 50%, Story402.Missing (not-compiled). A class is pass
when its unrounded ratio of covered to executable class lines is at least the minimum, fail below it, notApplicable with no
executable class line, and fail with a reason when it has no class-source result (it was not measured, or is not up to date).
overall is pass when the unrounded total over the classes that have a result is at least the minimum and no class failed for
want of a result, notApplicable when no class has an executable class line, and otherwise fail: a rounded 79.995 never
passes 80. A failing verdict is still isError: false. iris_test_status with the coverageRunId returns the same summary and
verdict from the handle alone. minCoverage omitted means no verdict: the result has no coverage.verdict and no Coverage target line, and no run is judged on its percentage.
A session that did not load every listed routine runs no test (Story 40.2). Start of the Line-by-Line session skips, without
an error, a routine that has no object code (for example a class deleted after the run resolved its list). The test process
compares the routines the session loaded with the run's list before any test runs; on a mismatch it stops its own session at
once (only after proving it is the run's), no test runs, and the run ends failed with an error that names the routines that
were not loaded and says that no test was run.
Cobertura XML (Story 40.2). iris_test_coverage writes no file. To give CI tools a Cobertura file, call iris_test_status
with action: "export", the run's coverageRunId and an absolute outputPath ending .xml (no .. segment; the same path guard
as iris_doc_export's destinationDir). That action is iris_test_status:export, a key of its own that is write and
DEFAULT-DISABLED: enable it with IRIS_GOVERNANCE={"global":{"iris_test_status:export":true}}. See the iris_test_status entry.
A CI recipe (Story 40.4).
- The operator enables the keys (the setting under "Defaults at a glance"; the export needs
iris_test_status:export). - Call
iris_test_coveragewithtarget,level,classes(the classes under test, not the test classes) andminCoverageset to the pipeline's gate. - A
status: "running"result is polled withiris_test_status(action: "poll", thecoverageRunId) until it completes; never re-submit. - Read
coverage.verdict.overall:pass,fail(a result, not a tool error:isErrorstaysfalse) ornotApplicable(no class has an executable class line, so there is nothing to export). Fail the pipeline onfail, and onnotApplicabletoo: it means nothing was measured, so checkclasses. Step 5 works for a failing verdict too, so export first when the CI tool should read the file of a failing run. - Call
iris_test_statuswithaction: "export", thecoverageRunId, an absoluteoutputPathending.xmland, for the repository's source directory,sourceRoot; point the CI tool's Cobertura reader at that file. The repository's.clsfiles must be in the layout IRIS stores (asiris_doc_exportwrites them).
Namespace Scoping
Most tools accept an optional namespace parameter to target a specific IRIS namespace. If omitted, the configured default namespace (IRIS_NAMESPACE environment variable) is used.
All 32 tools in this package accept the namespace parameter except:
iris_server_info-- Server-level info, no namespace needed
Tools that use the Atelier REST API (doc, compile, intelligence, server tools) resolve namespace via the Atelier URL path. Tools that use the custom REST endpoint (global, execute, SQL execute/query tools) pass namespace as a request parameter. iris_env_diff/iris_env_promote are the exception in spirit rather than mechanism: their namespace overrides BOTH the source and target profile's namespace identically (each side otherwise falls back to its own profile's configured default), rather than targeting one connection's namespace like every other tool here.
Error Handling
Common Errors
| Error | Cause | Resolution |
|---|---|---|
IRIS connection refused |
IRIS web server not running or wrong host/port | Verify IRIS_HOST and IRIS_PORT settings; ensure the IRIS web server is running |
401 Unauthorized |
Invalid credentials | Check IRIS_USERNAME and IRIS_PASSWORD |
404 Not Found on document operations |
Document does not exist in the target namespace | Verify the document name and namespace |
Compilation errors |
ObjectScript syntax errors in source code | Review the error details (line/character positions) returned in the compilation result |
SQL error |
Invalid SQL syntax or missing table | Check the query syntax and that referenced tables exist |
Custom REST endpoint not found |
Bootstrap has not completed | The server auto-bootstraps on first connection; save the web app via SMP if 404 persists |
<NAMESPACE> error |
Target namespace does not exist | Use iris_namespace_list (admin server) to verify available namespaces |
Error Response Format
All tool errors return a standard MCP error response:
{
"content": [{ "type": "text", "text": "Error description" }],
"isError": true
}
Compilation errors are returned as successful tool results (not isError: true) with structured error details including line and character positions.
Known Limitations
Non-ASCII request-body content was mis-decoded (fixed in Story 34.8)
iris_execute_command's command, iris_execute_classmethod's args, and iris_global_set's value are all read through a shared request-body parser. Before Story 34.8 it mis-decoded non-ASCII JSON content (UTF-8 read as Latin-1) — e.g. an emoji arrived corrupted as several garbled characters matching its raw UTF-8 byte values, with no error and no truncation flag (HTTP 200, silently wrong). For iris_global_set this corrupted data at rest in the target global.
This is now fixed — accented characters, CJK, and emoji all round-trip correctly, and plain ASCII is unaffected. The fix is forward-only: data already written corrupted (e.g. via iris_global_set before upgrading) is not automatically repaired — there is no repair tool for previously-corrupted data.
The decoder is lenient rather than validating: invalid byte sequences (orphan continuation bytes, truncated sequences, unpaired surrogates) are replaced with a literal ? under HTTP 200 rather than rejected, and non-canonical "overlong" encodings are decoded rather than refused — which has a filter-bypass implication if you byte-inspect these request bodies upstream. Full detail on both, plus the security note: see the suite README's Known Limitations and ledger item 34-6-CR-7.