@iris-mcp/data 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +199 -0
- package/LICENSE +21 -0
- package/README.md +612 -2
- package/dist/index.d.ts +11 -0
- package/dist/index.js +31 -0
- package/dist/tools/analytics.d.ts +43 -0
- package/dist/tools/analytics.js +227 -0
- package/dist/tools/debug.d.ts +14 -0
- package/dist/tools/debug.js +15 -0
- package/dist/tools/docdb.d.ts +118 -0
- package/dist/tools/docdb.js +637 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.js +21 -0
- package/dist/tools/presets.d.ts +16 -0
- package/dist/tools/presets.js +40 -0
- package/dist/tools/rest.d.ts +20 -0
- package/dist/tools/rest.js +407 -0
- package/package.json +58 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics tools for the IRIS Data & Analytics MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides two tools for IRIS DeepSee analytics:
|
|
5
|
+
* - {@link analyticsMdxTool} — Execute MDX queries and return structured
|
|
6
|
+
* pivot-table results with axis labels and measure values
|
|
7
|
+
* - {@link analyticsCubesTool} — List, build, or synchronize DeepSee cubes
|
|
8
|
+
*
|
|
9
|
+
* All tools call the custom ExecuteMCPv2 REST handler at
|
|
10
|
+
* `/api/executemcp/v2/analytics/...`.
|
|
11
|
+
*/
|
|
12
|
+
import { type ToolDefinition } from "@iris-mcp/shared";
|
|
13
|
+
export declare const analyticsMdxTool: ToolDefinition;
|
|
14
|
+
/**
|
|
15
|
+
* Convert an IRIS `$HOROLOG` timestamp (e.g., `"67360,85964.1540167"`) to
|
|
16
|
+
* ISO 8601 UTC format (e.g., `"2026-04-15T23:52:44.154Z"`).
|
|
17
|
+
*
|
|
18
|
+
* IRIS `$HOROLOG` epoch: day 0 = 1840-12-31, day 1 = 1841-01-01.
|
|
19
|
+
* Seconds are seconds-since-midnight in the server's local time zone.
|
|
20
|
+
* We treat them as UTC seconds since the cube endpoint does not carry a
|
|
21
|
+
* time-zone offset; callers needing zone-correct values should cross-check
|
|
22
|
+
* via `$ZDATETIME`.
|
|
23
|
+
*
|
|
24
|
+
* Returns `""` for missing, non-string, or malformed input — never throws.
|
|
25
|
+
* This ensures the tool stays resilient when IRIS emits an unexpected shape.
|
|
26
|
+
*
|
|
27
|
+
* @param h - The `$HOROLOG` string from IRIS.
|
|
28
|
+
* @returns ISO 8601 timestamp, or `""` when input is unusable.
|
|
29
|
+
*/
|
|
30
|
+
declare function horologToIso(h: unknown): string;
|
|
31
|
+
/**
|
|
32
|
+
* Map a cube-list payload's `cubes[]` array so each entry carries both
|
|
33
|
+
* the ISO-formatted `lastBuildTime` and the raw `lastBuildTimeRaw` horolog
|
|
34
|
+
* string. Returns the result unchanged if `cubes` is not an array.
|
|
35
|
+
*
|
|
36
|
+
* Bug #14: the IRIS analytics cube-list endpoint emits `lastBuildTime` as a
|
|
37
|
+
* raw `$HOROLOG` string, which is unreadable to MCP clients. This helper
|
|
38
|
+
* preserves the raw form so callers can still cross-check or round-trip.
|
|
39
|
+
*/
|
|
40
|
+
declare function mapCubeList(result: unknown): unknown;
|
|
41
|
+
export { horologToIso, mapCubeList };
|
|
42
|
+
export declare const analyticsCubesTool: ToolDefinition;
|
|
43
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics tools for the IRIS Data & Analytics MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides two tools for IRIS DeepSee analytics:
|
|
5
|
+
* - {@link analyticsMdxTool} — Execute MDX queries and return structured
|
|
6
|
+
* pivot-table results with axis labels and measure values
|
|
7
|
+
* - {@link analyticsCubesTool} — List, build, or synchronize DeepSee cubes
|
|
8
|
+
*
|
|
9
|
+
* All tools call the custom ExecuteMCPv2 REST handler at
|
|
10
|
+
* `/api/executemcp/v2/analytics/...`.
|
|
11
|
+
*/
|
|
12
|
+
import { IrisApiError } from "@iris-mcp/shared";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { extractResult, toStructured } from "./docdb.js";
|
|
15
|
+
/** Base URL for the ExecuteMCPv2 custom REST API. */
|
|
16
|
+
const BASE_URL = "/api/executemcp/v2";
|
|
17
|
+
// ── iris_analytics_mdx ────────────────────────────────────────
|
|
18
|
+
export const analyticsMdxTool = {
|
|
19
|
+
name: "iris_analytics_mdx",
|
|
20
|
+
title: "Execute MDX Query",
|
|
21
|
+
description: "Execute an MDX query against IRIS DeepSee and return structured " +
|
|
22
|
+
"pivot-table results with axis labels, measure values, and dimension " +
|
|
23
|
+
"members. Returns columns, rows (each with label and values), " +
|
|
24
|
+
"rowCount, and columnCount.",
|
|
25
|
+
inputSchema: z.object({
|
|
26
|
+
query: z
|
|
27
|
+
.string()
|
|
28
|
+
.min(1)
|
|
29
|
+
.describe("MDX query string to execute"),
|
|
30
|
+
namespace: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Target namespace (default: configured namespace)"),
|
|
34
|
+
}),
|
|
35
|
+
annotations: {
|
|
36
|
+
readOnlyHint: true,
|
|
37
|
+
destructiveHint: false,
|
|
38
|
+
idempotentHint: true,
|
|
39
|
+
openWorldHint: false,
|
|
40
|
+
},
|
|
41
|
+
scope: "NS",
|
|
42
|
+
handler: async (args, ctx) => {
|
|
43
|
+
const { query, namespace } = args;
|
|
44
|
+
const ns = ctx.resolveNamespace(namespace);
|
|
45
|
+
try {
|
|
46
|
+
const response = await ctx.http.post(`${BASE_URL}/analytics/mdx`, {
|
|
47
|
+
query,
|
|
48
|
+
namespace: ns,
|
|
49
|
+
});
|
|
50
|
+
const result = extractResult(response);
|
|
51
|
+
return {
|
|
52
|
+
content: [
|
|
53
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
54
|
+
],
|
|
55
|
+
structuredContent: toStructured(result),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (error instanceof IrisApiError) {
|
|
60
|
+
return {
|
|
61
|
+
content: [
|
|
62
|
+
{
|
|
63
|
+
type: "text",
|
|
64
|
+
text: `Error executing MDX query: ${error.message}`,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
isError: true,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
// ── horolog → ISO 8601 helper ─────────────────────────────────
|
|
75
|
+
/**
|
|
76
|
+
* Convert an IRIS `$HOROLOG` timestamp (e.g., `"67360,85964.1540167"`) to
|
|
77
|
+
* ISO 8601 UTC format (e.g., `"2026-04-15T23:52:44.154Z"`).
|
|
78
|
+
*
|
|
79
|
+
* IRIS `$HOROLOG` epoch: day 0 = 1840-12-31, day 1 = 1841-01-01.
|
|
80
|
+
* Seconds are seconds-since-midnight in the server's local time zone.
|
|
81
|
+
* We treat them as UTC seconds since the cube endpoint does not carry a
|
|
82
|
+
* time-zone offset; callers needing zone-correct values should cross-check
|
|
83
|
+
* via `$ZDATETIME`.
|
|
84
|
+
*
|
|
85
|
+
* Returns `""` for missing, non-string, or malformed input — never throws.
|
|
86
|
+
* This ensures the tool stays resilient when IRIS emits an unexpected shape.
|
|
87
|
+
*
|
|
88
|
+
* @param h - The `$HOROLOG` string from IRIS.
|
|
89
|
+
* @returns ISO 8601 timestamp, or `""` when input is unusable.
|
|
90
|
+
*/
|
|
91
|
+
function horologToIso(h) {
|
|
92
|
+
if (!h || typeof h !== "string" || !h.includes(","))
|
|
93
|
+
return "";
|
|
94
|
+
const [daysStr, secondsStr] = h.split(",");
|
|
95
|
+
const days = parseInt(daysStr ?? "", 10);
|
|
96
|
+
const seconds = parseFloat(secondsStr ?? "");
|
|
97
|
+
if (!Number.isFinite(days) || !Number.isFinite(seconds))
|
|
98
|
+
return "";
|
|
99
|
+
// Date.UTC(1840, 11, 31) gives ms-since-1970 for $HOROLOG day 0 midnight UTC.
|
|
100
|
+
const epoch = Date.UTC(1840, 11, 31);
|
|
101
|
+
const ms = epoch + (days * 86400 + seconds) * 1000;
|
|
102
|
+
const d = new Date(ms);
|
|
103
|
+
if (!Number.isFinite(d.getTime()))
|
|
104
|
+
return "";
|
|
105
|
+
return d.toISOString();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Map a cube-list payload's `cubes[]` array so each entry carries both
|
|
109
|
+
* the ISO-formatted `lastBuildTime` and the raw `lastBuildTimeRaw` horolog
|
|
110
|
+
* string. Returns the result unchanged if `cubes` is not an array.
|
|
111
|
+
*
|
|
112
|
+
* Bug #14: the IRIS analytics cube-list endpoint emits `lastBuildTime` as a
|
|
113
|
+
* raw `$HOROLOG` string, which is unreadable to MCP clients. This helper
|
|
114
|
+
* preserves the raw form so callers can still cross-check or round-trip.
|
|
115
|
+
*/
|
|
116
|
+
function mapCubeList(result) {
|
|
117
|
+
if (result === null ||
|
|
118
|
+
typeof result !== "object" ||
|
|
119
|
+
Array.isArray(result)) {
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
const record = result;
|
|
123
|
+
const cubes = record.cubes;
|
|
124
|
+
if (!Array.isArray(cubes))
|
|
125
|
+
return result;
|
|
126
|
+
const mappedCubes = cubes.map((cube) => {
|
|
127
|
+
if (cube === null || typeof cube !== "object")
|
|
128
|
+
return cube;
|
|
129
|
+
const cubeRec = cube;
|
|
130
|
+
const raw = cubeRec.lastBuildTime;
|
|
131
|
+
return {
|
|
132
|
+
...cubeRec,
|
|
133
|
+
lastBuildTime: horologToIso(raw),
|
|
134
|
+
lastBuildTimeRaw: typeof raw === "string" ? raw : "",
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
return { ...record, cubes: mappedCubes };
|
|
138
|
+
}
|
|
139
|
+
// Exported for unit testing.
|
|
140
|
+
export { horologToIso, mapCubeList };
|
|
141
|
+
// ── iris_analytics_cubes ──────────────────────────────────────
|
|
142
|
+
export const analyticsCubesTool = {
|
|
143
|
+
name: "iris_analytics_cubes",
|
|
144
|
+
title: "Manage DeepSee Cubes",
|
|
145
|
+
description: "List, build, or synchronize IRIS DeepSee cubes. " +
|
|
146
|
+
"'list' returns all cubes with name, source class, fact count, and both `lastBuildTime` " +
|
|
147
|
+
"(ISO 8601 UTC) and `lastBuildTimeRaw` ($HOROLOG string) fields. " +
|
|
148
|
+
"'build' triggers a full synchronous rebuild of a cube. " +
|
|
149
|
+
"'sync' triggers an incremental synchronization of a cube.",
|
|
150
|
+
inputSchema: z.object({
|
|
151
|
+
action: z
|
|
152
|
+
.enum(["list", "build", "sync"])
|
|
153
|
+
.describe("Action to perform: 'list', 'build', or 'sync'"),
|
|
154
|
+
cube: z
|
|
155
|
+
.string()
|
|
156
|
+
.min(1)
|
|
157
|
+
.optional()
|
|
158
|
+
.describe("Cube name (required for 'build' and 'sync')"),
|
|
159
|
+
namespace: z
|
|
160
|
+
.string()
|
|
161
|
+
.optional()
|
|
162
|
+
.describe("Target namespace (default: configured namespace)"),
|
|
163
|
+
}),
|
|
164
|
+
annotations: {
|
|
165
|
+
destructiveHint: false,
|
|
166
|
+
readOnlyHint: false,
|
|
167
|
+
idempotentHint: false,
|
|
168
|
+
openWorldHint: false,
|
|
169
|
+
},
|
|
170
|
+
scope: "NS",
|
|
171
|
+
handler: async (args, ctx) => {
|
|
172
|
+
const { action, cube, namespace } = args;
|
|
173
|
+
const ns = ctx.resolveNamespace(namespace);
|
|
174
|
+
try {
|
|
175
|
+
let response;
|
|
176
|
+
if (action === "list") {
|
|
177
|
+
const qp = encodeURIComponent(ns);
|
|
178
|
+
response = await ctx.http.get(`${BASE_URL}/analytics/cubes?namespace=${qp}`);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
// build or sync
|
|
182
|
+
if (!cube) {
|
|
183
|
+
return {
|
|
184
|
+
content: [
|
|
185
|
+
{
|
|
186
|
+
type: "text",
|
|
187
|
+
text: `Error: 'cube' is required for '${action}' action`,
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
isError: true,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
response = await ctx.http.post(`${BASE_URL}/analytics/cubes`, {
|
|
194
|
+
action,
|
|
195
|
+
cube,
|
|
196
|
+
namespace: ns,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
// Bug #14: convert cube `lastBuildTime` from raw $HOROLOG to ISO 8601
|
|
200
|
+
// on list action; preserve raw value in `lastBuildTimeRaw`. Build/sync
|
|
201
|
+
// responses carry status fields, not cube rows, so no mapping needed.
|
|
202
|
+
const rawResult = extractResult(response);
|
|
203
|
+
const result = action === "list" ? mapCubeList(rawResult) : rawResult;
|
|
204
|
+
return {
|
|
205
|
+
content: [
|
|
206
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
207
|
+
],
|
|
208
|
+
structuredContent: toStructured(result),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
if (error instanceof IrisApiError) {
|
|
213
|
+
return {
|
|
214
|
+
content: [
|
|
215
|
+
{
|
|
216
|
+
type: "text",
|
|
217
|
+
text: `Error managing cubes: ${error.message}`,
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
isError: true,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
throw error;
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug tools placeholder for future post-MVP implementation.
|
|
3
|
+
*
|
|
4
|
+
* FR106: iris_debug_session — Interactive ObjectScript debug sessions
|
|
5
|
+
* FR107: iris_debug_terminal — IRIS terminal via WebSocket
|
|
6
|
+
*
|
|
7
|
+
* These tools are deferred to post-MVP and will require WebSocket
|
|
8
|
+
* transport support (not available over the stdio transport).
|
|
9
|
+
*
|
|
10
|
+
* When implemented, these tools will be added to the tools array in
|
|
11
|
+
* tools/index.ts and registered with the MCP server.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug tools placeholder for future post-MVP implementation.
|
|
3
|
+
*
|
|
4
|
+
* FR106: iris_debug_session — Interactive ObjectScript debug sessions
|
|
5
|
+
* FR107: iris_debug_terminal — IRIS terminal via WebSocket
|
|
6
|
+
*
|
|
7
|
+
* These tools are deferred to post-MVP and will require WebSocket
|
|
8
|
+
* transport support (not available over the stdio transport).
|
|
9
|
+
*
|
|
10
|
+
* When implemented, these tools will be added to the tools array in
|
|
11
|
+
* tools/index.ts and registered with the MCP server.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
// No exports — placeholder only
|
|
15
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Database (DocDB) tools for the IRIS Data & Analytics MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Provides four tools for managing IRIS document databases:
|
|
5
|
+
* - {@link docdbManageTool} — Create, drop, or list document databases
|
|
6
|
+
* - {@link docdbDocumentTool} — Insert, get, update, or delete documents
|
|
7
|
+
* - {@link docdbFindTool} — Query documents with filter criteria
|
|
8
|
+
* - {@link docdbPropertyTool} — Create, drop, or index properties
|
|
9
|
+
*
|
|
10
|
+
* All tools call the IRIS built-in DocDB REST API at
|
|
11
|
+
* `/api/docdb/v1/{namespace}/...`. No custom ObjectScript handler
|
|
12
|
+
* is required.
|
|
13
|
+
*
|
|
14
|
+
* ## DocDB API contract notes (from reading %Api.DocDB.v1.cls and %DocDB.Database.cls)
|
|
15
|
+
*
|
|
16
|
+
* ### Property create (BUG-5 fix)
|
|
17
|
+
* `POST /api/docdb/v1/{ns}/prop/{db}/{prop}` reads `type` from
|
|
18
|
+
* `%request.Data("type",1)` — i.e., a **URL query parameter**, not the
|
|
19
|
+
* JSON body. Sending `{type: "..."}` in the body is silently ignored and
|
|
20
|
+
* the server defaults to `%String`. Fix: append `?type=<encoded>` to the
|
|
21
|
+
* URL and send an empty body `{}`.
|
|
22
|
+
*
|
|
23
|
+
* ENCODING: IRIS type names start with `%` (e.g. `%Integer`).
|
|
24
|
+
* `encodeURIComponent` turns `%` into `%25`, but the IRIS CSP layer does
|
|
25
|
+
* NOT URL-decode `%XX` sequences in `%request.Data` — it reads `%25Integer`
|
|
26
|
+
* literally, causing lookup failure for class `%Library.25Integer`.
|
|
27
|
+
* Fix: split on `%`, encode each segment, rejoin with `%`.
|
|
28
|
+
* This keeps the type `%` prefix as a literal `%` while encoding any other
|
|
29
|
+
* special characters in the type name. Verified via direct HTTP probe.
|
|
30
|
+
*
|
|
31
|
+
* ### Find / filter (BUG-6 fix)
|
|
32
|
+
* `POST /api/docdb/v1/{ns}/find/{db}` reads `requestBody.restriction`,
|
|
33
|
+
* `.projection`, and `.options` from the JSON body. `restriction` is
|
|
34
|
+
* either a single DocDB predicate array `[field, value, operator]` or an
|
|
35
|
+
* array of such arrays (combined with AND). The MongoDB-style filter
|
|
36
|
+
* `{field: {$gt: value}}` must be translated to `["field", value, ">"]`.
|
|
37
|
+
* Supported operators: $eq → =, $ne → !=, $lt → <, $lte → <=, $gt → >,
|
|
38
|
+
* $gte → >=. Multiple field/op pairs are combined as an array of predicates.
|
|
39
|
+
*/
|
|
40
|
+
import { IrisApiError, type ToolContext, type ToolDefinition } from "@iris-mcp/shared";
|
|
41
|
+
/**
|
|
42
|
+
* Translate a MongoDB-style filter object to a DocDB restriction value.
|
|
43
|
+
*
|
|
44
|
+
* The DocDB `%FindDocuments()` method accepts a `restriction` argument that
|
|
45
|
+
* is either:
|
|
46
|
+
* - A single predicate array: `[field, value, operator]`
|
|
47
|
+
* - An array of predicate arrays for AND-combination: `[[f1,v1,op1],[f2,v2,op2]]`
|
|
48
|
+
*
|
|
49
|
+
* This function converts:
|
|
50
|
+
* ```json
|
|
51
|
+
* { "age": { "$gt": 26 }, "name": { "$eq": "Alice" } }
|
|
52
|
+
* ```
|
|
53
|
+
* to:
|
|
54
|
+
* ```json
|
|
55
|
+
* [["age", 26, ">"], ["name", "Alice", "="]]
|
|
56
|
+
* ```
|
|
57
|
+
* A single predicate is returned as a flat `[field, value, operator]` array
|
|
58
|
+
* (not nested) per the DocDB API contract.
|
|
59
|
+
*
|
|
60
|
+
* Unsupported operators are silently skipped.
|
|
61
|
+
*
|
|
62
|
+
* @param filter - The MongoDB-style filter object.
|
|
63
|
+
* @returns The DocDB restriction value, or `null` if no predicates could be built.
|
|
64
|
+
*/
|
|
65
|
+
export declare function buildDocDbRestriction(filter: Record<string, unknown>): unknown[] | null;
|
|
66
|
+
/**
|
|
67
|
+
* Extract the usable result from a DocDB API response.
|
|
68
|
+
*
|
|
69
|
+
* The {@link IrisHttpClient} casts every JSON response to
|
|
70
|
+
* `AtelierEnvelope<T>`, but the DocDB API returns plain JSON
|
|
71
|
+
* (no `{status, console, result}` wrapper). When the response
|
|
72
|
+
* lacks the Atelier envelope, `.result` is `undefined` and the
|
|
73
|
+
* actual data sits at the top level of the parsed object.
|
|
74
|
+
*
|
|
75
|
+
* @param response - The parsed response from `ctx.http.*`.
|
|
76
|
+
* @returns The actual data payload.
|
|
77
|
+
*/
|
|
78
|
+
export declare function extractResult(response: unknown): unknown;
|
|
79
|
+
/**
|
|
80
|
+
* Ensure a value is a record suitable for MCP `structuredContent`.
|
|
81
|
+
* MCP requires structuredContent to be a JSON object (record), not an array.
|
|
82
|
+
* Arrays are wrapped in `{ items, count }`.
|
|
83
|
+
*/
|
|
84
|
+
export declare function toStructured(value: unknown): Record<string, unknown>;
|
|
85
|
+
/**
|
|
86
|
+
* Translate a DocDB access-denied failure into an actionable error message
|
|
87
|
+
* when the root cause is a disabled `%Service_DocDB` (Story 35.7,
|
|
88
|
+
* AC 35.7.1/35.7.3/35.7.4).
|
|
89
|
+
*
|
|
90
|
+
* Returns the enriched message when (and only when) ALL of the following
|
|
91
|
+
* hold; returns `null` (caller passes the original error through unchanged)
|
|
92
|
+
* otherwise:
|
|
93
|
+
*
|
|
94
|
+
* - the error carries an `errors[]` entry with numeric `code === 822`
|
|
95
|
+
* (the real disabled-service shape is HTTP 200 with a code-822 object in
|
|
96
|
+
* `status.errors[]` — never match message text, never branch on the HTTP
|
|
97
|
+
* status); AND
|
|
98
|
+
* - a follow-up `GET /api/executemcp/v2/security/service?name=...` reports
|
|
99
|
+
* `%Service_DocDB` as `enabled: false`.
|
|
100
|
+
*
|
|
101
|
+
* Pass-through is total: service enabled (genuine privilege failure),
|
|
102
|
+
* service-state check itself failing, unexpected response shape, or a
|
|
103
|
+
* non-822 error all return `null` — a secondary failure must never mask
|
|
104
|
+
* the real error.
|
|
105
|
+
*
|
|
106
|
+
* This is a catch-path translation, not a pre-check: the extra round-trip
|
|
107
|
+
* happens only when a call has already failed with 822.
|
|
108
|
+
*
|
|
109
|
+
* @param ctx - Tool context (used for the single service-state follow-up).
|
|
110
|
+
* @param error - The `IrisApiError` thrown by the DocDB call.
|
|
111
|
+
* @returns The actionable message, or `null` for pass-through.
|
|
112
|
+
*/
|
|
113
|
+
export declare function translateDocDbAccessDenied(ctx: ToolContext, error: IrisApiError): Promise<string | null>;
|
|
114
|
+
export declare const docdbManageTool: ToolDefinition;
|
|
115
|
+
export declare const docdbDocumentTool: ToolDefinition;
|
|
116
|
+
export declare const docdbFindTool: ToolDefinition;
|
|
117
|
+
export declare const docdbPropertyTool: ToolDefinition;
|
|
118
|
+
//# sourceMappingURL=docdb.d.ts.map
|