@mcp-abap-adt/core 4.9.0 → 5.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -0
  3. package/dist/handlers/compact/high/compactSchemas.d.ts +76 -0
  4. package/dist/handlers/compact/high/compactSchemas.d.ts.map +1 -1
  5. package/dist/handlers/compact/high/compactSchemas.js +47 -1
  6. package/dist/handlers/compact/high/compactSchemas.js.map +1 -1
  7. package/dist/handlers/compact/high/handleHandlerFeedList.d.ts +50 -0
  8. package/dist/handlers/compact/high/handleHandlerFeedList.d.ts.map +1 -0
  9. package/dist/handlers/compact/high/handleHandlerFeedList.js +16 -0
  10. package/dist/handlers/compact/high/handleHandlerFeedList.js.map +1 -0
  11. package/dist/handlers/compact/high/handleHandlerGatewayErrorList.d.ts +48 -0
  12. package/dist/handlers/compact/high/handleHandlerGatewayErrorList.d.ts.map +1 -0
  13. package/dist/handlers/compact/high/handleHandlerGatewayErrorList.js +16 -0
  14. package/dist/handlers/compact/high/handleHandlerGatewayErrorList.js.map +1 -0
  15. package/dist/handlers/compact/high/handleHandlerSystemMessageList.d.ts +43 -0
  16. package/dist/handlers/compact/high/handleHandlerSystemMessageList.d.ts.map +1 -0
  17. package/dist/handlers/compact/high/handleHandlerSystemMessageList.js +16 -0
  18. package/dist/handlers/compact/high/handleHandlerSystemMessageList.js.map +1 -0
  19. package/dist/handlers/system/readonly/handleRuntimeAnalyzeProfilerTrace.d.ts.map +1 -1
  20. package/dist/handlers/system/readonly/handleRuntimeAnalyzeProfilerTrace.js +4 -3
  21. package/dist/handlers/system/readonly/handleRuntimeAnalyzeProfilerTrace.js.map +1 -1
  22. package/dist/handlers/system/readonly/handleRuntimeCreateProfilerTraceParameters.d.ts.map +1 -1
  23. package/dist/handlers/system/readonly/handleRuntimeCreateProfilerTraceParameters.js +3 -2
  24. package/dist/handlers/system/readonly/handleRuntimeCreateProfilerTraceParameters.js.map +1 -1
  25. package/dist/handlers/system/readonly/handleRuntimeGetDumpById.js +1 -1
  26. package/dist/handlers/system/readonly/handleRuntimeGetDumpById.js.map +1 -1
  27. package/dist/handlers/system/readonly/handleRuntimeGetGatewayErrorLog.d.ts +48 -0
  28. package/dist/handlers/system/readonly/handleRuntimeGetGatewayErrorLog.d.ts.map +1 -0
  29. package/dist/handlers/system/readonly/handleRuntimeGetGatewayErrorLog.js +81 -0
  30. package/dist/handlers/system/readonly/handleRuntimeGetGatewayErrorLog.js.map +1 -0
  31. package/dist/handlers/system/readonly/handleRuntimeGetProfilerTraceData.d.ts.map +1 -1
  32. package/dist/handlers/system/readonly/handleRuntimeGetProfilerTraceData.js +4 -3
  33. package/dist/handlers/system/readonly/handleRuntimeGetProfilerTraceData.js.map +1 -1
  34. package/dist/handlers/system/readonly/handleRuntimeListDumps.d.ts.map +1 -1
  35. package/dist/handlers/system/readonly/handleRuntimeListDumps.js +3 -2
  36. package/dist/handlers/system/readonly/handleRuntimeListDumps.js.map +1 -1
  37. package/dist/handlers/system/readonly/handleRuntimeListFeeds.d.ts +50 -0
  38. package/dist/handlers/system/readonly/handleRuntimeListFeeds.d.ts.map +1 -0
  39. package/dist/handlers/system/readonly/handleRuntimeListFeeds.js +94 -0
  40. package/dist/handlers/system/readonly/handleRuntimeListFeeds.js.map +1 -0
  41. package/dist/handlers/system/readonly/handleRuntimeListProfilerTraceFiles.js +1 -1
  42. package/dist/handlers/system/readonly/handleRuntimeListProfilerTraceFiles.js.map +1 -1
  43. package/dist/handlers/system/readonly/handleRuntimeListSystemMessages.d.ts +43 -0
  44. package/dist/handlers/system/readonly/handleRuntimeListSystemMessages.d.ts.map +1 -0
  45. package/dist/handlers/system/readonly/handleRuntimeListSystemMessages.js +62 -0
  46. package/dist/handlers/system/readonly/handleRuntimeListSystemMessages.js.map +1 -0
  47. package/dist/lib/handlers/groups/CompactHandlersGroup.d.ts.map +1 -1
  48. package/dist/lib/handlers/groups/CompactHandlersGroup.js +15 -0
  49. package/dist/lib/handlers/groups/CompactHandlersGroup.js.map +1 -1
  50. package/dist/lib/handlers/groups/SystemHandlersGroup.d.ts.map +1 -1
  51. package/dist/lib/handlers/groups/SystemHandlersGroup.js +15 -0
  52. package/dist/lib/handlers/groups/SystemHandlersGroup.js.map +1 -1
  53. package/docs/superpowers/plans/2026-04-11-migrate-adt-clients-4.0.0.md +1014 -0
  54. package/docs/user-guide/AVAILABLE_TOOLS.md +116 -22
  55. package/docs/user-guide/AVAILABLE_TOOLS_COMPACT.md +49 -2
  56. package/docs/user-guide/AVAILABLE_TOOLS_HIGH.md +53 -6
  57. package/docs/user-guide/AVAILABLE_TOOLS_LEGACY.md +1 -1
  58. package/docs/user-guide/AVAILABLE_TOOLS_LOW.md +1 -1
  59. package/docs/user-guide/AVAILABLE_TOOLS_READONLY.md +62 -15
  60. package/package.json +2 -2
@@ -0,0 +1,1014 @@
1
+ # Migrate to @mcp-abap-adt/adt-clients 4.0.0
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
+
5
+ **Goal:** Migrate runtime handlers to adt-clients 4.0.0 (factory pattern API) and add new handlers for feeds, system messages, and gateway error log.
6
+
7
+ **Architecture:** Update existing 6 runtime handlers to use `getProfiler()`/`getDumps()` factory methods instead of flat `AdtRuntimeClient` methods. Add 3 new granular system handlers using `FeedRepository` (which parses Atom XML internally). Add 3 compact wrapper handlers. Register everything in the appropriate handler groups.
8
+
9
+ **Tech Stack:** TypeScript, @mcp-abap-adt/adt-clients@4.0.0, @mcp-abap-adt/interfaces@6.0.0
10
+
11
+ ---
12
+
13
+ ## File Map
14
+
15
+ **Modified files (breaking change fixes):**
16
+ - `package.json` — bump adt-clients dependency
17
+ - `src/handlers/system/readonly/handleRuntimeListProfilerTraceFiles.ts` — `listProfilerTraceFiles()` → `getProfiler().list()`
18
+ - `src/handlers/system/readonly/handleRuntimeGetProfilerTraceData.ts` — flat methods → `getProfiler().getHitList/getStatements/getDbAccesses()`
19
+ - `src/handlers/system/readonly/handleRuntimeAnalyzeProfilerTrace.ts` — same profiler method changes
20
+ - `src/handlers/system/readonly/handleRuntimeCreateProfilerTraceParameters.ts` — `createProfilerTraceParameters()` → `getProfiler().createParameters()`, `extractProfilerIdFromResponse()` → `getProfiler().extractIdFromResponse()`
21
+ - `src/handlers/system/readonly/handleRuntimeListDumps.ts` — `listRuntimeDumps()` → `getDumps().list()`, `listRuntimeDumpsByUser()` → `getDumps().listByUser()`
22
+ - `src/handlers/system/readonly/handleRuntimeGetDumpById.ts` — `getRuntimeDumpById()` → `getDumps().getById()`, remove unused `buildDumpIdPrefix` import
23
+ - `src/lib/handlers/groups/SystemHandlersGroup.ts` — register 3 new system handlers
24
+ - `src/lib/handlers/groups/CompactHandlersGroup.ts` — register 3 new compact handlers
25
+ - `src/handlers/compact/high/compactSchemas.ts` — add schemas for new compact handlers
26
+
27
+ **New files:**
28
+ - `src/handlers/system/readonly/handleRuntimeListFeeds.ts` — list feeds + read specific feed
29
+ - `src/handlers/system/readonly/handleRuntimeListSystemMessages.ts` — SM02 system messages
30
+ - `src/handlers/system/readonly/handleRuntimeGetGatewayErrorLog.ts` — gateway error log + detail
31
+ - `src/handlers/compact/high/handleHandlerFeedList.ts` — compact wrapper for feeds
32
+ - `src/handlers/compact/high/handleHandlerSystemMessageList.ts` — compact wrapper for system messages
33
+ - `src/handlers/compact/high/handleHandlerGatewayErrorList.ts` — compact wrapper for gateway errors
34
+
35
+ ---
36
+
37
+ ### Task 1: Bump adt-clients dependency
38
+
39
+ **Files:**
40
+ - Modify: `package.json:139`
41
+
42
+ - [ ] **Step 1: Update dependency version**
43
+
44
+ In `package.json`, change:
45
+ ```
46
+ "@mcp-abap-adt/adt-clients": "^3.14.5",
47
+ ```
48
+ to:
49
+ ```
50
+ "@mcp-abap-adt/adt-clients": "^4.0.0",
51
+ ```
52
+
53
+ - [ ] **Step 2: Install**
54
+
55
+ Run: `npm install`
56
+ Expected: Successful install, no peer dependency errors.
57
+
58
+ - [ ] **Step 3: Commit**
59
+
60
+ ```bash
61
+ git add package.json package-lock.json
62
+ git commit -m "chore: bump @mcp-abap-adt/adt-clients to ^4.0.0"
63
+ ```
64
+
65
+ ---
66
+
67
+ ### Task 2: Fix profiler handlers (breaking changes)
68
+
69
+ **Files:**
70
+ - Modify: `src/handlers/system/readonly/handleRuntimeListProfilerTraceFiles.ts`
71
+ - Modify: `src/handlers/system/readonly/handleRuntimeGetProfilerTraceData.ts`
72
+ - Modify: `src/handlers/system/readonly/handleRuntimeAnalyzeProfilerTrace.ts`
73
+ - Modify: `src/handlers/system/readonly/handleRuntimeCreateProfilerTraceParameters.ts`
74
+
75
+ All four files follow the same pattern: create `AdtRuntimeClient`, then call flat methods. In v4.0.0, these become `getProfiler().*` calls.
76
+
77
+ - [ ] **Step 1: Fix handleRuntimeListProfilerTraceFiles.ts**
78
+
79
+ Replace line 25:
80
+ ```typescript
81
+ const response = await runtimeClient.listProfilerTraceFiles();
82
+ ```
83
+ with:
84
+ ```typescript
85
+ const response = await runtimeClient.getProfiler().list();
86
+ ```
87
+
88
+ - [ ] **Step 2: Fix handleRuntimeGetProfilerTraceData.ts**
89
+
90
+ Replace lines 67-85 (the entire ternary chain):
91
+ ```typescript
92
+ const response =
93
+ args.view === 'hitlist'
94
+ ? await runtimeClient.getProfilerTraceHitList(args.trace_id_or_uri, {
95
+ withSystemEvents: args.with_system_events,
96
+ })
97
+ : args.view === 'statements'
98
+ ? await runtimeClient.getProfilerTraceStatements(
99
+ args.trace_id_or_uri,
100
+ {
101
+ id: args.id,
102
+ withDetails: args.with_details,
103
+ autoDrillDownThreshold: args.auto_drill_down_threshold,
104
+ withSystemEvents: args.with_system_events,
105
+ },
106
+ )
107
+ : await runtimeClient.getProfilerTraceDbAccesses(
108
+ args.trace_id_or_uri,
109
+ {
110
+ withSystemEvents: args.with_system_events,
111
+ },
112
+ );
113
+ ```
114
+ with:
115
+ ```typescript
116
+ const profiler = runtimeClient.getProfiler();
117
+ const response =
118
+ args.view === 'hitlist'
119
+ ? await profiler.getHitList(args.trace_id_or_uri, {
120
+ withSystemEvents: args.with_system_events,
121
+ })
122
+ : args.view === 'statements'
123
+ ? await profiler.getStatements(
124
+ args.trace_id_or_uri,
125
+ {
126
+ id: args.id,
127
+ withDetails: args.with_details,
128
+ autoDrillDownThreshold: args.auto_drill_down_threshold,
129
+ withSystemEvents: args.with_system_events,
130
+ },
131
+ )
132
+ : await profiler.getDbAccesses(
133
+ args.trace_id_or_uri,
134
+ {
135
+ withSystemEvents: args.with_system_events,
136
+ },
137
+ );
138
+ ```
139
+
140
+ - [ ] **Step 3: Fix handleRuntimeAnalyzeProfilerTrace.ts**
141
+
142
+ Replace lines 132-149 (the ternary chain):
143
+ ```typescript
144
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
145
+ const response =
146
+ view === 'hitlist'
147
+ ? await runtimeClient.getProfilerTraceHitList(args.trace_id_or_uri, {
148
+ withSystemEvents: args.with_system_events,
149
+ })
150
+ : view === 'statements'
151
+ ? await runtimeClient.getProfilerTraceStatements(
152
+ args.trace_id_or_uri,
153
+ {
154
+ withSystemEvents: args.with_system_events,
155
+ },
156
+ )
157
+ : await runtimeClient.getProfilerTraceDbAccesses(
158
+ args.trace_id_or_uri,
159
+ {
160
+ withSystemEvents: args.with_system_events,
161
+ },
162
+ );
163
+ ```
164
+ with:
165
+ ```typescript
166
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
167
+ const profiler = runtimeClient.getProfiler();
168
+ const response =
169
+ view === 'hitlist'
170
+ ? await profiler.getHitList(args.trace_id_or_uri, {
171
+ withSystemEvents: args.with_system_events,
172
+ })
173
+ : view === 'statements'
174
+ ? await profiler.getStatements(
175
+ args.trace_id_or_uri,
176
+ {
177
+ withSystemEvents: args.with_system_events,
178
+ },
179
+ )
180
+ : await profiler.getDbAccesses(
181
+ args.trace_id_or_uri,
182
+ {
183
+ withSystemEvents: args.with_system_events,
184
+ },
185
+ );
186
+ ```
187
+
188
+ - [ ] **Step 4: Fix handleRuntimeCreateProfilerTraceParameters.ts**
189
+
190
+ Replace lines 60-77:
191
+ ```typescript
192
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
193
+ const response = await runtimeClient.createProfilerTraceParameters({
194
+ description: args.description,
195
+ allMiscAbapStatements: args.all_misc_abap_statements,
196
+ allProceduralUnits: args.all_procedural_units,
197
+ allInternalTableEvents: args.all_internal_table_events,
198
+ allDynproEvents: args.all_dynpro_events,
199
+ aggregate: args.aggregate,
200
+ explicitOnOff: args.explicit_on_off,
201
+ withRfcTracing: args.with_rfc_tracing,
202
+ allSystemKernelEvents: args.all_system_kernel_events,
203
+ sqlTrace: args.sql_trace,
204
+ allDbEvents: args.all_db_events,
205
+ maxSizeForTraceFile: args.max_size_for_trace_file,
206
+ amdpTrace: args.amdp_trace,
207
+ maxTimeForTracing: args.max_time_for_tracing,
208
+ });
209
+
210
+ const profilerId = runtimeClient.extractProfilerIdFromResponse(response);
211
+ ```
212
+ with:
213
+ ```typescript
214
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
215
+ const profiler = runtimeClient.getProfiler();
216
+ const response = await profiler.createParameters({
217
+ description: args.description,
218
+ allMiscAbapStatements: args.all_misc_abap_statements,
219
+ allProceduralUnits: args.all_procedural_units,
220
+ allInternalTableEvents: args.all_internal_table_events,
221
+ allDynproEvents: args.all_dynpro_events,
222
+ aggregate: args.aggregate,
223
+ explicitOnOff: args.explicit_on_off,
224
+ withRfcTracing: args.with_rfc_tracing,
225
+ allSystemKernelEvents: args.all_system_kernel_events,
226
+ sqlTrace: args.sql_trace,
227
+ allDbEvents: args.all_db_events,
228
+ maxSizeForTraceFile: args.max_size_for_trace_file,
229
+ amdpTrace: args.amdp_trace,
230
+ maxTimeForTracing: args.max_time_for_tracing,
231
+ });
232
+
233
+ const profilerId = profiler.extractIdFromResponse(response);
234
+ ```
235
+
236
+ - [ ] **Step 5: Verify TypeScript compilation**
237
+
238
+ Run: `npx tsc --noEmit 2>&1 | head -30`
239
+ Expected: No errors related to profiler handler files.
240
+
241
+ - [ ] **Step 6: Commit**
242
+
243
+ ```bash
244
+ git add src/handlers/system/readonly/handleRuntimeListProfilerTraceFiles.ts \
245
+ src/handlers/system/readonly/handleRuntimeGetProfilerTraceData.ts \
246
+ src/handlers/system/readonly/handleRuntimeAnalyzeProfilerTrace.ts \
247
+ src/handlers/system/readonly/handleRuntimeCreateProfilerTraceParameters.ts
248
+ git commit -m "refactor: migrate profiler handlers to adt-clients 4.0.0 factory API"
249
+ ```
250
+
251
+ ---
252
+
253
+ ### Task 3: Fix dump handlers (breaking changes)
254
+
255
+ **Files:**
256
+ - Modify: `src/handlers/system/readonly/handleRuntimeListDumps.ts`
257
+ - Modify: `src/handlers/system/readonly/handleRuntimeGetDumpById.ts`
258
+
259
+ - [ ] **Step 1: Fix handleRuntimeListDumps.ts**
260
+
261
+ Replace lines 93-109:
262
+ ```typescript
263
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
264
+ const { user, from, to, inlinecount, top, skip, orderby } = args || {};
265
+
266
+ const response = user
267
+ ? await runtimeClient.listRuntimeDumpsByUser(user, {
268
+ from,
269
+ to,
270
+ inlinecount,
271
+ top,
272
+ skip,
273
+ orderby,
274
+ })
275
+ : await runtimeClient.listRuntimeDumps({
276
+ from,
277
+ to,
278
+ inlinecount,
279
+ top,
280
+ skip,
281
+ orderby,
282
+ });
283
+ ```
284
+ with:
285
+ ```typescript
286
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
287
+ const dumps = runtimeClient.getDumps();
288
+ const { user, from, to, inlinecount, top, skip, orderby } = args || {};
289
+
290
+ const response = user
291
+ ? await dumps.listByUser(user, {
292
+ from,
293
+ to,
294
+ inlinecount,
295
+ top,
296
+ skip,
297
+ orderby,
298
+ })
299
+ : await dumps.list({
300
+ from,
301
+ to,
302
+ inlinecount,
303
+ top,
304
+ skip,
305
+ orderby,
306
+ });
307
+ ```
308
+
309
+ - [ ] **Step 2: Fix handleRuntimeGetDumpById.ts**
310
+
311
+ Change the import on line 1 — remove unused `buildDumpIdPrefix`:
312
+ ```typescript
313
+ import { AdtRuntimeClient, buildDumpIdPrefix } from '@mcp-abap-adt/adt-clients';
314
+ ```
315
+ to:
316
+ ```typescript
317
+ import { AdtRuntimeClient } from '@mcp-abap-adt/adt-clients';
318
+ ```
319
+
320
+ Replace lines 167-168:
321
+ ```typescript
322
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
323
+ const response = await runtimeClient.getRuntimeDumpById(dumpId, { view });
324
+ ```
325
+ with:
326
+ ```typescript
327
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
328
+ const response = await runtimeClient.getDumps().getById(dumpId, { view });
329
+ ```
330
+
331
+ - [ ] **Step 3: Verify TypeScript compilation**
332
+
333
+ Run: `npx tsc --noEmit 2>&1 | head -30`
334
+ Expected: No errors related to dump handler files.
335
+
336
+ - [ ] **Step 4: Commit**
337
+
338
+ ```bash
339
+ git add src/handlers/system/readonly/handleRuntimeListDumps.ts \
340
+ src/handlers/system/readonly/handleRuntimeGetDumpById.ts
341
+ git commit -m "refactor: migrate dump handlers to adt-clients 4.0.0 factory API"
342
+ ```
343
+
344
+ ---
345
+
346
+ ### Task 4: Add RuntimeListFeeds handler
347
+
348
+ **Files:**
349
+ - Create: `src/handlers/system/readonly/handleRuntimeListFeeds.ts`
350
+
351
+ The `FeedRepository` from adt-clients 4.0.0 parses Atom XML internally and returns typed domain objects. We use `client.getFeeds()` which returns `IFeedRepository` with methods: `list()`, `variants()`, `dumps()`, `systemMessages()`, `gatewayErrors()`, `gatewayErrorDetail()`.
352
+
353
+ - [ ] **Step 1: Create handler file**
354
+
355
+ Create `src/handlers/system/readonly/handleRuntimeListFeeds.ts`:
356
+
357
+ ```typescript
358
+ import { AdtRuntimeClient } from '@mcp-abap-adt/adt-clients';
359
+ import type { HandlerContext } from '../../../lib/handlers/interfaces';
360
+ import { return_error, return_response } from '../../../lib/utils';
361
+
362
+ export const TOOL_DEFINITION = {
363
+ name: 'RuntimeListFeeds',
364
+ available_in: ['onprem', 'cloud'] as const,
365
+ description:
366
+ '[runtime] List available ADT runtime feeds or read a specific feed type. Feed types: dumps, system_messages, gateway_errors. Without feed_type returns available feed descriptors.',
367
+ inputSchema: {
368
+ type: 'object',
369
+ properties: {
370
+ feed_type: {
371
+ type: 'string',
372
+ enum: ['descriptors', 'variants', 'dumps', 'system_messages', 'gateway_errors'],
373
+ description:
374
+ 'Feed to read. "descriptors" lists available feeds, "variants" lists feed variants, others read that specific feed. Default: descriptors.',
375
+ default: 'descriptors',
376
+ },
377
+ user: {
378
+ type: 'string',
379
+ description: 'Filter feed entries by SAP username.',
380
+ },
381
+ max_results: {
382
+ type: 'number',
383
+ description: 'Maximum number of entries to return.',
384
+ },
385
+ from: {
386
+ type: 'string',
387
+ description: 'Start of time range in YYYYMMDDHHMMSS format.',
388
+ },
389
+ to: {
390
+ type: 'string',
391
+ description: 'End of time range in YYYYMMDDHHMMSS format.',
392
+ },
393
+ },
394
+ required: [],
395
+ },
396
+ } as const;
397
+
398
+ interface RuntimeListFeedsArgs {
399
+ feed_type?: 'descriptors' | 'variants' | 'dumps' | 'system_messages' | 'gateway_errors';
400
+ user?: string;
401
+ max_results?: number;
402
+ from?: string;
403
+ to?: string;
404
+ }
405
+
406
+ export async function handleRuntimeListFeeds(
407
+ context: HandlerContext,
408
+ args: RuntimeListFeedsArgs,
409
+ ) {
410
+ const { connection, logger } = context;
411
+
412
+ try {
413
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
414
+ const feeds = runtimeClient.getFeeds();
415
+ const feedType = args?.feed_type ?? 'descriptors';
416
+
417
+ const queryOptions = {
418
+ user: args?.user,
419
+ maxResults: args?.max_results,
420
+ from: args?.from,
421
+ to: args?.to,
422
+ };
423
+
424
+ let data: unknown;
425
+
426
+ switch (feedType) {
427
+ case 'descriptors':
428
+ data = await feeds.list();
429
+ break;
430
+ case 'variants':
431
+ data = await feeds.variants();
432
+ break;
433
+ case 'dumps':
434
+ data = await feeds.dumps(queryOptions);
435
+ break;
436
+ case 'system_messages':
437
+ data = await feeds.systemMessages(queryOptions);
438
+ break;
439
+ case 'gateway_errors':
440
+ data = await feeds.gatewayErrors(queryOptions);
441
+ break;
442
+ }
443
+
444
+ return return_response({
445
+ data: JSON.stringify(
446
+ {
447
+ success: true,
448
+ feed_type: feedType,
449
+ count: Array.isArray(data) ? data.length : undefined,
450
+ entries: data,
451
+ },
452
+ null,
453
+ 2,
454
+ ),
455
+ status: 200,
456
+ statusText: 'OK',
457
+ headers: {},
458
+ config: {},
459
+ });
460
+ } catch (error: unknown) {
461
+ logger?.error('Error reading feeds:', error);
462
+ return return_error(error);
463
+ }
464
+ }
465
+ ```
466
+
467
+ - [ ] **Step 2: Verify compilation**
468
+
469
+ Run: `npx tsc --noEmit 2>&1 | head -30`
470
+ Expected: No errors.
471
+
472
+ - [ ] **Step 3: Commit**
473
+
474
+ ```bash
475
+ git add src/handlers/system/readonly/handleRuntimeListFeeds.ts
476
+ git commit -m "feat: add RuntimeListFeeds handler for ADT feed reader"
477
+ ```
478
+
479
+ ---
480
+
481
+ ### Task 5: Add RuntimeListSystemMessages handler
482
+
483
+ **Files:**
484
+ - Create: `src/handlers/system/readonly/handleRuntimeListSystemMessages.ts`
485
+
486
+ Uses `FeedRepository.systemMessages()` which returns parsed `ISystemMessageEntry[]` (id, title, text, severity, validFrom, validTo, createdBy).
487
+
488
+ - [ ] **Step 1: Create handler file**
489
+
490
+ Create `src/handlers/system/readonly/handleRuntimeListSystemMessages.ts`:
491
+
492
+ ```typescript
493
+ import { AdtRuntimeClient } from '@mcp-abap-adt/adt-clients';
494
+ import type { HandlerContext } from '../../../lib/handlers/interfaces';
495
+ import { return_error, return_response } from '../../../lib/utils';
496
+
497
+ export const TOOL_DEFINITION = {
498
+ name: 'RuntimeListSystemMessages',
499
+ available_in: ['onprem', 'cloud'] as const,
500
+ description:
501
+ '[runtime] List SM02 system messages. Returns structured entries with id, title, text, severity, validity period, and author.',
502
+ inputSchema: {
503
+ type: 'object',
504
+ properties: {
505
+ user: {
506
+ type: 'string',
507
+ description: 'Filter by author username.',
508
+ },
509
+ max_results: {
510
+ type: 'number',
511
+ description: 'Maximum number of messages to return.',
512
+ },
513
+ from: {
514
+ type: 'string',
515
+ description: 'Start of time range in YYYYMMDDHHMMSS format.',
516
+ },
517
+ to: {
518
+ type: 'string',
519
+ description: 'End of time range in YYYYMMDDHHMMSS format.',
520
+ },
521
+ },
522
+ required: [],
523
+ },
524
+ } as const;
525
+
526
+ interface RuntimeListSystemMessagesArgs {
527
+ user?: string;
528
+ max_results?: number;
529
+ from?: string;
530
+ to?: string;
531
+ }
532
+
533
+ export async function handleRuntimeListSystemMessages(
534
+ context: HandlerContext,
535
+ args: RuntimeListSystemMessagesArgs,
536
+ ) {
537
+ const { connection, logger } = context;
538
+
539
+ try {
540
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
541
+ const feeds = runtimeClient.getFeeds();
542
+
543
+ const messages = await feeds.systemMessages({
544
+ user: args?.user,
545
+ maxResults: args?.max_results,
546
+ from: args?.from,
547
+ to: args?.to,
548
+ });
549
+
550
+ return return_response({
551
+ data: JSON.stringify(
552
+ {
553
+ success: true,
554
+ count: messages.length,
555
+ messages,
556
+ },
557
+ null,
558
+ 2,
559
+ ),
560
+ status: 200,
561
+ statusText: 'OK',
562
+ headers: {},
563
+ config: {},
564
+ });
565
+ } catch (error: unknown) {
566
+ logger?.error('Error listing system messages:', error);
567
+ return return_error(error);
568
+ }
569
+ }
570
+ ```
571
+
572
+ - [ ] **Step 2: Verify compilation**
573
+
574
+ Run: `npx tsc --noEmit 2>&1 | head -30`
575
+
576
+ - [ ] **Step 3: Commit**
577
+
578
+ ```bash
579
+ git add src/handlers/system/readonly/handleRuntimeListSystemMessages.ts
580
+ git commit -m "feat: add RuntimeListSystemMessages handler for SM02 messages"
581
+ ```
582
+
583
+ ---
584
+
585
+ ### Task 6: Add RuntimeGetGatewayErrorLog handler
586
+
587
+ **Files:**
588
+ - Create: `src/handlers/system/readonly/handleRuntimeGetGatewayErrorLog.ts`
589
+
590
+ Uses `FeedRepository.gatewayErrors()` for listing (returns `IGatewayErrorEntry[]`) and `FeedRepository.gatewayErrorDetail()` for detail (returns `IGatewayErrorDetail` with serviceInfo, errorContext, sourceCode, callStack).
591
+
592
+ - [ ] **Step 1: Create handler file**
593
+
594
+ Create `src/handlers/system/readonly/handleRuntimeGetGatewayErrorLog.ts`:
595
+
596
+ ```typescript
597
+ import { AdtRuntimeClient } from '@mcp-abap-adt/adt-clients';
598
+ import type { HandlerContext } from '../../../lib/handlers/interfaces';
599
+ import { return_error, return_response } from '../../../lib/utils';
600
+
601
+ export const TOOL_DEFINITION = {
602
+ name: 'RuntimeGetGatewayErrorLog',
603
+ available_in: ['onprem'] as const,
604
+ description:
605
+ '[runtime] List SAP Gateway error log (/IWFND/ERROR_LOG) or get error detail. Returns structured entries with type, shortText, transactionId, dateTime, username. With error_url returns full detail including serviceInfo, errorContext, sourceCode, callStack.',
606
+ inputSchema: {
607
+ type: 'object',
608
+ properties: {
609
+ error_url: {
610
+ type: 'string',
611
+ description:
612
+ 'Feed URL of a specific error entry (from a previous list response link field). When provided, returns detailed error info instead of listing.',
613
+ },
614
+ user: {
615
+ type: 'string',
616
+ description: 'Filter errors by SAP username.',
617
+ },
618
+ max_results: {
619
+ type: 'number',
620
+ description: 'Maximum number of errors to return.',
621
+ },
622
+ from: {
623
+ type: 'string',
624
+ description: 'Start of time range in YYYYMMDDHHMMSS format.',
625
+ },
626
+ to: {
627
+ type: 'string',
628
+ description: 'End of time range in YYYYMMDDHHMMSS format.',
629
+ },
630
+ },
631
+ required: [],
632
+ },
633
+ } as const;
634
+
635
+ interface RuntimeGetGatewayErrorLogArgs {
636
+ error_url?: string;
637
+ user?: string;
638
+ max_results?: number;
639
+ from?: string;
640
+ to?: string;
641
+ }
642
+
643
+ export async function handleRuntimeGetGatewayErrorLog(
644
+ context: HandlerContext,
645
+ args: RuntimeGetGatewayErrorLogArgs,
646
+ ) {
647
+ const { connection, logger } = context;
648
+
649
+ try {
650
+ const runtimeClient = new AdtRuntimeClient(connection, logger);
651
+ const feeds = runtimeClient.getFeeds();
652
+
653
+ if (args?.error_url) {
654
+ const detail = await feeds.gatewayErrorDetail(args.error_url);
655
+ return return_response({
656
+ data: JSON.stringify(
657
+ {
658
+ success: true,
659
+ mode: 'detail',
660
+ error: detail,
661
+ },
662
+ null,
663
+ 2,
664
+ ),
665
+ status: 200,
666
+ statusText: 'OK',
667
+ headers: {},
668
+ config: {},
669
+ });
670
+ }
671
+
672
+ const errors = await feeds.gatewayErrors({
673
+ user: args?.user,
674
+ maxResults: args?.max_results,
675
+ from: args?.from,
676
+ to: args?.to,
677
+ });
678
+
679
+ return return_response({
680
+ data: JSON.stringify(
681
+ {
682
+ success: true,
683
+ mode: 'list',
684
+ count: errors.length,
685
+ errors,
686
+ },
687
+ null,
688
+ 2,
689
+ ),
690
+ status: 200,
691
+ statusText: 'OK',
692
+ headers: {},
693
+ config: {},
694
+ });
695
+ } catch (error: unknown) {
696
+ logger?.error('Error reading gateway error log:', error);
697
+ return return_error(error);
698
+ }
699
+ }
700
+ ```
701
+
702
+ - [ ] **Step 2: Verify compilation**
703
+
704
+ Run: `npx tsc --noEmit 2>&1 | head -30`
705
+
706
+ - [ ] **Step 3: Commit**
707
+
708
+ ```bash
709
+ git add src/handlers/system/readonly/handleRuntimeGetGatewayErrorLog.ts
710
+ git commit -m "feat: add RuntimeGetGatewayErrorLog handler for /IWFND/ERROR_LOG"
711
+ ```
712
+
713
+ ---
714
+
715
+ ### Task 7: Register new handlers in SystemHandlersGroup
716
+
717
+ **Files:**
718
+ - Modify: `src/lib/handlers/groups/SystemHandlersGroup.ts`
719
+
720
+ - [ ] **Step 1: Add imports**
721
+
722
+ Add after line 100 (after the last runtime import):
723
+
724
+ ```typescript
725
+ import {
726
+ handleRuntimeListFeeds,
727
+ TOOL_DEFINITION as RuntimeListFeeds_Tool,
728
+ } from '../../../handlers/system/readonly/handleRuntimeListFeeds';
729
+ import {
730
+ handleRuntimeListSystemMessages,
731
+ TOOL_DEFINITION as RuntimeListSystemMessages_Tool,
732
+ } from '../../../handlers/system/readonly/handleRuntimeListSystemMessages';
733
+ import {
734
+ handleRuntimeGetGatewayErrorLog,
735
+ TOOL_DEFINITION as RuntimeGetGatewayErrorLog_Tool,
736
+ } from '../../../handlers/system/readonly/handleRuntimeGetGatewayErrorLog';
737
+ ```
738
+
739
+ - [ ] **Step 2: Add handler entries**
740
+
741
+ Add after the `RuntimeAnalyzeProfilerTrace` entry (after line 160) in the `getHandlers()` return array:
742
+
743
+ ```typescript
744
+ {
745
+ toolDefinition: RuntimeListFeeds_Tool,
746
+ handler: (args: any) => handleRuntimeListFeeds(this.context, args),
747
+ },
748
+ {
749
+ toolDefinition: RuntimeListSystemMessages_Tool,
750
+ handler: (args: any) =>
751
+ handleRuntimeListSystemMessages(this.context, args),
752
+ },
753
+ {
754
+ toolDefinition: RuntimeGetGatewayErrorLog_Tool,
755
+ handler: (args: any) =>
756
+ handleRuntimeGetGatewayErrorLog(this.context, args),
757
+ },
758
+ ```
759
+
760
+ - [ ] **Step 3: Verify compilation**
761
+
762
+ Run: `npx tsc --noEmit 2>&1 | head -30`
763
+
764
+ - [ ] **Step 4: Commit**
765
+
766
+ ```bash
767
+ git add src/lib/handlers/groups/SystemHandlersGroup.ts
768
+ git commit -m "feat: register new runtime feed handlers in SystemHandlersGroup"
769
+ ```
770
+
771
+ ---
772
+
773
+ ### Task 8: Add compact schemas and wrapper handlers
774
+
775
+ **Files:**
776
+ - Modify: `src/handlers/compact/high/compactSchemas.ts`
777
+ - Create: `src/handlers/compact/high/handleHandlerFeedList.ts`
778
+ - Create: `src/handlers/compact/high/handleHandlerSystemMessageList.ts`
779
+ - Create: `src/handlers/compact/high/handleHandlerGatewayErrorList.ts`
780
+
781
+ - [ ] **Step 1: Add compact schemas**
782
+
783
+ Append to `src/handlers/compact/high/compactSchemas.ts` (after the last export, line 698):
784
+
785
+ ```typescript
786
+
787
+ export const compactFeedListSchema = {
788
+ type: 'object',
789
+ properties: {
790
+ feed_type: {
791
+ type: 'string',
792
+ enum: ['descriptors', 'variants', 'dumps', 'system_messages', 'gateway_errors'],
793
+ default: 'descriptors',
794
+ description: 'Feed type to read.',
795
+ },
796
+ user: { type: 'string', description: 'Filter by username.' },
797
+ max_results: { type: 'number', description: 'Limit entries returned.' },
798
+ from: { type: 'string', description: 'Start datetime YYYYMMDDHHMMSS.' },
799
+ to: { type: 'string', description: 'End datetime YYYYMMDDHHMMSS.' },
800
+ },
801
+ required: [],
802
+ } as const;
803
+
804
+ export const compactSystemMessageListSchema = {
805
+ type: 'object',
806
+ properties: {
807
+ user: { type: 'string', description: 'Filter by author username.' },
808
+ max_results: { type: 'number', description: 'Limit messages returned.' },
809
+ from: { type: 'string', description: 'Start datetime YYYYMMDDHHMMSS.' },
810
+ to: { type: 'string', description: 'End datetime YYYYMMDDHHMMSS.' },
811
+ },
812
+ required: [],
813
+ } as const;
814
+
815
+ export const compactGatewayErrorListSchema = {
816
+ type: 'object',
817
+ properties: {
818
+ error_url: { type: 'string', description: 'Error feed URL for detail view.' },
819
+ user: { type: 'string', description: 'Filter by username.' },
820
+ max_results: { type: 'number', description: 'Limit errors returned.' },
821
+ from: { type: 'string', description: 'Start datetime YYYYMMDDHHMMSS.' },
822
+ to: { type: 'string', description: 'End datetime YYYYMMDDHHMMSS.' },
823
+ },
824
+ required: [],
825
+ } as const;
826
+ ```
827
+
828
+ - [ ] **Step 2: Create handleHandlerFeedList.ts**
829
+
830
+ Create `src/handlers/compact/high/handleHandlerFeedList.ts`:
831
+
832
+ ```typescript
833
+ import type { HandlerContext } from '../../../lib/handlers/interfaces';
834
+ import { handleRuntimeListFeeds } from '../../system/readonly/handleRuntimeListFeeds';
835
+ import { compactFeedListSchema } from './compactSchemas';
836
+
837
+ export const TOOL_DEFINITION = {
838
+ name: 'HandlerFeedList',
839
+ available_in: ['onprem', 'cloud'] as const,
840
+ description:
841
+ 'Runtime feed list. object_type: not used. Required: none. Optional: feed_type, user, max_results, from, to. Response: JSON.',
842
+ inputSchema: compactFeedListSchema,
843
+ } as const;
844
+
845
+ type HandlerFeedListArgs = {
846
+ feed_type?: 'descriptors' | 'variants' | 'dumps' | 'system_messages' | 'gateway_errors';
847
+ user?: string;
848
+ max_results?: number;
849
+ from?: string;
850
+ to?: string;
851
+ };
852
+
853
+ export async function handleHandlerFeedList(
854
+ context: HandlerContext,
855
+ args: HandlerFeedListArgs,
856
+ ) {
857
+ return handleRuntimeListFeeds(context, args);
858
+ }
859
+ ```
860
+
861
+ - [ ] **Step 3: Create handleHandlerSystemMessageList.ts**
862
+
863
+ Create `src/handlers/compact/high/handleHandlerSystemMessageList.ts`:
864
+
865
+ ```typescript
866
+ import type { HandlerContext } from '../../../lib/handlers/interfaces';
867
+ import { handleRuntimeListSystemMessages } from '../../system/readonly/handleRuntimeListSystemMessages';
868
+ import { compactSystemMessageListSchema } from './compactSchemas';
869
+
870
+ export const TOOL_DEFINITION = {
871
+ name: 'HandlerSystemMessageList',
872
+ available_in: ['onprem', 'cloud'] as const,
873
+ description:
874
+ 'SM02 system messages list. object_type: not used. Required: none. Optional: user, max_results, from, to. Response: JSON.',
875
+ inputSchema: compactSystemMessageListSchema,
876
+ } as const;
877
+
878
+ type HandlerSystemMessageListArgs = {
879
+ user?: string;
880
+ max_results?: number;
881
+ from?: string;
882
+ to?: string;
883
+ };
884
+
885
+ export async function handleHandlerSystemMessageList(
886
+ context: HandlerContext,
887
+ args: HandlerSystemMessageListArgs,
888
+ ) {
889
+ return handleRuntimeListSystemMessages(context, args);
890
+ }
891
+ ```
892
+
893
+ - [ ] **Step 4: Create handleHandlerGatewayErrorList.ts**
894
+
895
+ Create `src/handlers/compact/high/handleHandlerGatewayErrorList.ts`:
896
+
897
+ ```typescript
898
+ import type { HandlerContext } from '../../../lib/handlers/interfaces';
899
+ import { handleRuntimeGetGatewayErrorLog } from '../../system/readonly/handleRuntimeGetGatewayErrorLog';
900
+ import { compactGatewayErrorListSchema } from './compactSchemas';
901
+
902
+ export const TOOL_DEFINITION = {
903
+ name: 'HandlerGatewayErrorList',
904
+ available_in: ['onprem'] as const,
905
+ description:
906
+ 'Gateway error log list/detail. object_type: not used. Required: none. Optional: error_url, user, max_results, from, to. Response: JSON.',
907
+ inputSchema: compactGatewayErrorListSchema,
908
+ } as const;
909
+
910
+ type HandlerGatewayErrorListArgs = {
911
+ error_url?: string;
912
+ user?: string;
913
+ max_results?: number;
914
+ from?: string;
915
+ to?: string;
916
+ };
917
+
918
+ export async function handleHandlerGatewayErrorList(
919
+ context: HandlerContext,
920
+ args: HandlerGatewayErrorListArgs,
921
+ ) {
922
+ return handleRuntimeGetGatewayErrorLog(context, args);
923
+ }
924
+ ```
925
+
926
+ - [ ] **Step 5: Verify compilation**
927
+
928
+ Run: `npx tsc --noEmit 2>&1 | head -30`
929
+
930
+ - [ ] **Step 6: Commit**
931
+
932
+ ```bash
933
+ git add src/handlers/compact/high/compactSchemas.ts \
934
+ src/handlers/compact/high/handleHandlerFeedList.ts \
935
+ src/handlers/compact/high/handleHandlerSystemMessageList.ts \
936
+ src/handlers/compact/high/handleHandlerGatewayErrorList.ts
937
+ git commit -m "feat: add compact wrapper handlers for feeds, system messages, gateway errors"
938
+ ```
939
+
940
+ ---
941
+
942
+ ### Task 9: Register compact handlers in CompactHandlersGroup
943
+
944
+ **Files:**
945
+ - Modify: `src/lib/handlers/groups/CompactHandlersGroup.ts`
946
+
947
+ - [ ] **Step 1: Add imports**
948
+
949
+ Add after line 31 (after the HandlerDumpView import):
950
+
951
+ ```typescript
952
+ import {
953
+ TOOL_DEFINITION as HandlerFeedList_Tool,
954
+ handleHandlerFeedList,
955
+ } from '../../../handlers/compact/high/handleHandlerFeedList';
956
+ import {
957
+ TOOL_DEFINITION as HandlerSystemMessageList_Tool,
958
+ handleHandlerSystemMessageList,
959
+ } from '../../../handlers/compact/high/handleHandlerSystemMessageList';
960
+ import {
961
+ TOOL_DEFINITION as HandlerGatewayErrorList_Tool,
962
+ handleHandlerGatewayErrorList,
963
+ } from '../../../handlers/compact/high/handleHandlerGatewayErrorList';
964
+ ```
965
+
966
+ - [ ] **Step 2: Add handler entries**
967
+
968
+ Add after the `HandlerDumpView` entry (after line 163) in the return array:
969
+
970
+ ```typescript
971
+ {
972
+ toolDefinition: HandlerFeedList_Tool,
973
+ handler: withContext(handleHandlerFeedList),
974
+ },
975
+ {
976
+ toolDefinition: HandlerSystemMessageList_Tool,
977
+ handler: withContext(handleHandlerSystemMessageList),
978
+ },
979
+ {
980
+ toolDefinition: HandlerGatewayErrorList_Tool,
981
+ handler: withContext(handleHandlerGatewayErrorList),
982
+ },
983
+ ```
984
+
985
+ - [ ] **Step 3: Full compilation check**
986
+
987
+ Run: `npx tsc --noEmit`
988
+ Expected: Clean build with zero errors.
989
+
990
+ - [ ] **Step 4: Commit**
991
+
992
+ ```bash
993
+ git add src/lib/handlers/groups/CompactHandlersGroup.ts
994
+ git commit -m "feat: register compact feed/sysmsg/gwerror handlers in CompactHandlersGroup"
995
+ ```
996
+
997
+ ---
998
+
999
+ ### Task 10: Final verification
1000
+
1001
+ - [ ] **Step 1: Full TypeScript build**
1002
+
1003
+ Run: `npm run build`
1004
+ Expected: Successful build.
1005
+
1006
+ - [ ] **Step 2: Run unit tests**
1007
+
1008
+ Run: `npm test -- --testPathPattern='unit' 2>&1 | tail -20`
1009
+ Expected: All unit tests pass.
1010
+
1011
+ - [ ] **Step 3: Lint check**
1012
+
1013
+ Run: `npm run lint 2>&1 | tail -20`
1014
+ Expected: No lint errors on modified/new files.