@mseep/bw-modeling-mcp 0.8.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 +140 -0
- package/LICENSE +21 -0
- package/README.md +598 -0
- package/dist/bw-client.js +774 -0
- package/dist/index.js +2199 -0
- package/dist/tools/activation.js +171 -0
- package/dist/tools/adso.js +895 -0
- package/dist/tools/composite_provider.js +169 -0
- package/dist/tools/cp_components.js +347 -0
- package/dist/tools/dataflow.js +148 -0
- package/dist/tools/datasource.js +536 -0
- package/dist/tools/delete.js +22 -0
- package/dist/tools/dtp.js +602 -0
- package/dist/tools/infoarea.js +117 -0
- package/dist/tools/infoobject.js +447 -0
- package/dist/tools/infosource.js +225 -0
- package/dist/tools/processchain.js +154 -0
- package/dist/tools/processvariant.js +49 -0
- package/dist/tools/push.js +100 -0
- package/dist/tools/query.js +631 -0
- package/dist/tools/reporting.js +558 -0
- package/dist/tools/repository.js +84 -0
- package/dist/tools/request_monitor.js +174 -0
- package/dist/tools/roles.js +503 -0
- package/dist/tools/search.js +107 -0
- package/dist/tools/transformation.js +1392 -0
- package/package.json +51 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2199 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { createClientFromEnv } from './bw-client.js';
|
|
6
|
+
import { bwGetAdso, bwCreateAdso, bwUpdateAdso, bwUpdateAdsoAddPureField, bwUpdateAdsoSettings, bwUpdateAdsoManageKeys, bwUpdateAdsoFieldProperties } from './tools/adso.js';
|
|
7
|
+
import { bwGetInfoObject, bwCreateInfoObject, bwUpdateInfoObject } from './tools/infoobject.js';
|
|
8
|
+
import { bwGetTransformation, bwUpdateTransformation, bwCreateTransformation, bwSetTransformationRuntime, bwSetTransformationRoutine, bwDeleteTransformationRoutine } from './tools/transformation.js';
|
|
9
|
+
import { bwActivate } from './tools/activation.js';
|
|
10
|
+
import { bwGetDtps, bwGetDtp, bwCreateDtp, bwRunDtp, bwUpdateDtp, bwSetDtpFilterRoutine } from './tools/dtp.js';
|
|
11
|
+
import { bwSearch, bwXref } from './tools/search.js';
|
|
12
|
+
import { bwDelete } from './tools/delete.js';
|
|
13
|
+
import { bwCreateInfoArea, bwMoveObject, bwGetInfoarea } from './tools/infoarea.js';
|
|
14
|
+
import { bwCreateInfosource, bwUpdateInfosource, bwGetInfosource } from './tools/infosource.js';
|
|
15
|
+
import { bwPushData, bwGetPushSchema } from './tools/push.js';
|
|
16
|
+
import { bwGetQuery } from './tools/query.js';
|
|
17
|
+
import { bwGetCompositeProvider } from './tools/composite_provider.js';
|
|
18
|
+
import { bwGetCkf, bwGetRkf, bwGetStructure } from './tools/cp_components.js';
|
|
19
|
+
import { bwListContents } from './tools/repository.js';
|
|
20
|
+
import { bwListSourceSystems, bwListDatasources, bwGetSourceSystem, bwGetDatasource, bwPreviewDatasource } from './tools/datasource.js';
|
|
21
|
+
import { bwGetDataflow } from './tools/dataflow.js';
|
|
22
|
+
import { bwQueryData, bwGetFilterValues } from './tools/reporting.js';
|
|
23
|
+
import { bwGetRoles, bwGetQueryRoles, bwSetQueryRoles, bwGetRoleQueries } from './tools/roles.js';
|
|
24
|
+
import { bwGetProcessChain } from './tools/processchain.js';
|
|
25
|
+
import { bwGetProcessVariant } from './tools/processvariant.js';
|
|
26
|
+
import { bwListRequests, bwGetRequest, bwActivateRequest } from './tools/request_monitor.js';
|
|
27
|
+
// Single shared client instance (CSRF token + session cookies are reused)
|
|
28
|
+
const client = createClientFromEnv();
|
|
29
|
+
const server = new Server({ name: 'bw-modeling-mcp', version: '0.1.0' }, { capabilities: { tools: {} } });
|
|
30
|
+
// ── Tool definitions ─────────────────────────────────────────────────────────
|
|
31
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
32
|
+
tools: [
|
|
33
|
+
{
|
|
34
|
+
name: 'bw_search',
|
|
35
|
+
description: 'Universal search for BW objects by name or description. Use this whenever the user wants to find, list, or look up any BW object — aDSOs, queries (ELEM), transformations (TRFN), DTPs (DTPA), InfoObjects (IOBJ), InfoSources (ISFS), CompositeProviders (HCPR), DataSources (RSDS), InfoAreas (AREA), process chains (PRCH), and any other TLOGO type. ' +
|
|
36
|
+
'Supports wildcards (e.g. "Z*" to find all objects starting with Z). ' +
|
|
37
|
+
'Pass object_type to restrict results to a single type; omit it to search across all types. ' +
|
|
38
|
+
'Prefer this tool over type-specific get/list tools whenever the object name is unknown or a pattern is given.',
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
search_term: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Search string. Wildcards supported: * matches any sequence, ? matches a single character. Example: "Z*" finds all objects whose name starts with Z.',
|
|
45
|
+
},
|
|
46
|
+
object_type: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Optional TLOGO filter to restrict results to one object type. Common values: ADSO (aDSO), ELEM (BEx/BW query), TRFN (transformation), DTPA (DTP), IOBJ (InfoObject), ISFS (InfoSource), HCPR (CompositeProvider), RSDS (DataSource), AREA (InfoArea), PRCH (process chain). Leave empty to search all types.',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ['search_term'],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'bw_xref',
|
|
56
|
+
description: 'Find where-used / dependencies for a BW object. Returns all objects that reference the given object. ' +
|
|
57
|
+
'Use this to find the Transformation and DTPs that reference an aDSO, or to find which DTPs depend on a Transformation. ' +
|
|
58
|
+
'Use object_type=DTPA to find the process chain(s) a DTP belongs to — this is preferred over bw_get_dtp when only the process chain is needed.',
|
|
59
|
+
inputSchema: {
|
|
60
|
+
type: 'object',
|
|
61
|
+
properties: {
|
|
62
|
+
object_type: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
description: 'Object type: ADSO, TRFN, DTPA, IOBJ, etc.',
|
|
65
|
+
},
|
|
66
|
+
object_name: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
description: 'Object name (e.g. "ADSO_NAME" or "TRFN_UUID_KEY").',
|
|
69
|
+
},
|
|
70
|
+
source_system: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
description: 'Required for object_type "RSDS". Logical source system name (e.g. "LSYS_NAME"). The correct padded objectName is built automatically.',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
required: ['object_type', 'object_name'],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'bw_get_adso',
|
|
80
|
+
description: 'Read an aDSO (Advanced DataStore Object) structure — fields, settings, version.',
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
adso_name: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: 'aDSO name (e.g. "ADSO_NAME").',
|
|
87
|
+
},
|
|
88
|
+
format: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
enum: ['text', 'raw'],
|
|
91
|
+
description: 'Output format. "text" (default): compact human-readable summary. "raw": raw XML from BW.',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
required: ['adso_name'],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'bw_create_adso',
|
|
99
|
+
description: 'Create a new aDSO shell. ' +
|
|
100
|
+
'action "from_template" (default): proposes fields/keys/settings from a template object — pass template_name. Without template_name creates an empty standard shell. ' +
|
|
101
|
+
'The template can be an existing aDSO (template_type "ADSO", default) or a DataSource (template_type "RSDS"); for RSDS, source_system is required and the server proposes the DataSource fields. ' +
|
|
102
|
+
'action "empty": creates a minimal empty aDSO with the given adso_type preset (no fields). ' +
|
|
103
|
+
'After creation the aDSO is inactive — add fields with bw_update_adso, then call bw_activate.',
|
|
104
|
+
inputSchema: {
|
|
105
|
+
type: 'object',
|
|
106
|
+
properties: {
|
|
107
|
+
adso_name: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
description: 'Name for the new aDSO (e.g. "ADSO_NAME").',
|
|
110
|
+
},
|
|
111
|
+
label: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
description: 'Description / label for the new aDSO.',
|
|
114
|
+
},
|
|
115
|
+
info_area: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
description: 'InfoArea to create the aDSO in (e.g. "NEXTJUICE").',
|
|
118
|
+
},
|
|
119
|
+
action: {
|
|
120
|
+
type: 'string',
|
|
121
|
+
enum: ['from_template', 'empty'],
|
|
122
|
+
description: '"from_template" (default) or "empty".',
|
|
123
|
+
},
|
|
124
|
+
template_name: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
description: 'Template object to propose fields from (action "from_template" only). An aDSO name when template_type is "ADSO", or a DataSource name when template_type is "RSDS".',
|
|
127
|
+
},
|
|
128
|
+
template_type: {
|
|
129
|
+
type: 'string',
|
|
130
|
+
enum: ['ADSO', 'RSDS'],
|
|
131
|
+
description: 'Type of the template object for action "from_template": "ADSO" (default) to copy from an existing aDSO, or "RSDS" to propose fields from a DataSource. When "RSDS", source_system is required.',
|
|
132
|
+
},
|
|
133
|
+
source_system: {
|
|
134
|
+
type: 'string',
|
|
135
|
+
description: 'Source system name of the DataSource. Required when template_type is "RSDS".',
|
|
136
|
+
},
|
|
137
|
+
adso_type: {
|
|
138
|
+
type: 'string',
|
|
139
|
+
enum: ['standard', 'staging_inbound_only', 'staging_compress', 'staging_reporting', 'datamart', 'direct_update'],
|
|
140
|
+
description: 'aDSO type preset for action "empty" (default "standard").',
|
|
141
|
+
},
|
|
142
|
+
package: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
description: 'Development package (default "$TMP").',
|
|
145
|
+
},
|
|
146
|
+
write_interface: {
|
|
147
|
+
type: 'boolean',
|
|
148
|
+
description: 'Enable write interface (pushMode="true"). Default false.',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
required: ['adso_name', 'label', 'info_area'],
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'bw_update_adso',
|
|
156
|
+
description: 'Add/remove fields, change aDSO type/settings, manage key fields, or update individual field properties. ' +
|
|
157
|
+
'action "add_field" (default): add one or more InfoObject-backed fields — infoobject_name required. ' +
|
|
158
|
+
'action "remove_field": removes the field from the aDSO (and from the key if it was a key field). ' +
|
|
159
|
+
'action "add_pure_field": add one or more pure (non-InfoObject) fields — pass fields array with name, label, data_type, optional length/precision/scale/aggregation_behavior/is_key. ' +
|
|
160
|
+
'action "update_settings": change aDSO type preset and/or individual boolean flags — no infoobject_name needed. ' +
|
|
161
|
+
'action "manage_keys": replace the complete key field list — pass key_fields array (empty = no key fields). ' +
|
|
162
|
+
'action "update_field_properties": modify sidDeterminationMode, aggregationBehavior, fixedCurrency/Unit, or descriptions of a single field — pass field_name and properties. ' +
|
|
163
|
+
'Returns a lock_handle that must be passed to bw_activate to complete the operation. ' +
|
|
164
|
+
'Sequence: bw_update_adso → bw_activate (adso) → bw_activate (trfn) → bw_activate (each dtpa).',
|
|
165
|
+
inputSchema: {
|
|
166
|
+
type: 'object',
|
|
167
|
+
properties: {
|
|
168
|
+
adso_name: {
|
|
169
|
+
type: 'string',
|
|
170
|
+
description: 'aDSO name (e.g. "ADSO_NAME").',
|
|
171
|
+
},
|
|
172
|
+
infoobject_name: {
|
|
173
|
+
type: 'string',
|
|
174
|
+
description: 'InfoObject name or comma-separated list to add or remove (e.g. "IOBJ_NAME" or "IOBJ_A,IOBJ_B"). Required for add_field and remove_field.',
|
|
175
|
+
},
|
|
176
|
+
action: {
|
|
177
|
+
type: 'string',
|
|
178
|
+
enum: ['add_field', 'remove_field', 'add_pure_field', 'update_settings', 'manage_keys', 'update_field_properties'],
|
|
179
|
+
description: '"add_field" (default), "remove_field", "add_pure_field", "update_settings", "manage_keys", or "update_field_properties".',
|
|
180
|
+
},
|
|
181
|
+
fields: {
|
|
182
|
+
type: 'array',
|
|
183
|
+
description: 'Pure field definitions for action "add_pure_field".',
|
|
184
|
+
items: {
|
|
185
|
+
type: 'object',
|
|
186
|
+
properties: {
|
|
187
|
+
name: { type: 'string', description: 'Field name (uppercase).' },
|
|
188
|
+
label: { type: 'string', description: 'Field description.' },
|
|
189
|
+
data_type: { type: 'string', description: 'Data type (user-facing names). Fixed length, do not pass length: INT1, INT2, INT4, INT8, FLTP, DATS, TIMS, LANG, CUKY, UNIT, DF16_RAW. No length: CURR, QUAN, STRING, RAWSTRING. User-defined length: CHAR, NUMC, RAW, SSTRING. User-defined length+precision: DEC. Precision only: DF16_DEC, DF34_DEC. Fixed length: D16N (16), D34N (34).' },
|
|
190
|
+
length: { type: 'number', description: 'Length for character types (CHAR, NUMC).' },
|
|
191
|
+
precision: { type: 'number', description: 'Precision (total digits) for DEC. For CURR/QUAN use scale instead.' },
|
|
192
|
+
scale: { type: 'number', description: 'Decimal places for CURR, QUAN, DEC (maps to XML precision attribute for CURR/QUAN).' },
|
|
193
|
+
aggregation_behavior: { type: 'string', enum: ['SUM', 'MIN', 'MAX', 'AVG', 'LAST', 'NONE'], description: 'Aggregation (default SUM for numeric types). Use NONE for no aggregation.' },
|
|
194
|
+
is_key: { type: 'boolean', description: 'If true, also injects a <keyElement> entry.' },
|
|
195
|
+
},
|
|
196
|
+
required: ['name', 'label', 'data_type'],
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
field_name: {
|
|
200
|
+
type: 'string',
|
|
201
|
+
description: 'Field name to modify (only for action "update_field_properties"), e.g. "FIELD_NAME" or "AMOUNT_P".',
|
|
202
|
+
},
|
|
203
|
+
properties: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
description: 'Field properties to update (only for action "update_field_properties").',
|
|
206
|
+
properties: {
|
|
207
|
+
sid_determination_mode: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
enum: ['N', 'R', 'S', 'M'],
|
|
210
|
+
description: 'Master data check mode (InfoObject-backed fields only). N=none, R=reporting only, S=load/activate, M=load+SID.',
|
|
211
|
+
},
|
|
212
|
+
local_description: {
|
|
213
|
+
description: 'Local description override (InfoObject-backed). String to override, null to clear (revert to InfoObject text).',
|
|
214
|
+
},
|
|
215
|
+
aggregation_behavior: {
|
|
216
|
+
type: 'string',
|
|
217
|
+
enum: ['SUM', 'MIN', 'MAX', 'AVG', 'LAST', 'NONE'],
|
|
218
|
+
description: 'Aggregation behavior (pure fields only). Use NONE for no aggregation.',
|
|
219
|
+
},
|
|
220
|
+
fixed_currency: {
|
|
221
|
+
description: 'Fixed currency code (pure CURR fields). String to set, null to switch to dynamic currency.',
|
|
222
|
+
},
|
|
223
|
+
fixed_unit: {
|
|
224
|
+
description: 'Fixed unit of measure (pure QUAN fields). String to set, null to switch to dynamic unit.',
|
|
225
|
+
},
|
|
226
|
+
description: {
|
|
227
|
+
type: 'string',
|
|
228
|
+
description: 'Description label for pure fields (sets <localProperties><descriptions label="..."/>).',
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
key_fields: {
|
|
233
|
+
type: 'array',
|
|
234
|
+
items: { type: 'string' },
|
|
235
|
+
description: 'List of field names that should be key fields (only for action "manage_keys"). Empty array removes all key fields.',
|
|
236
|
+
},
|
|
237
|
+
settings: {
|
|
238
|
+
type: 'object',
|
|
239
|
+
description: 'Settings to apply (only for action "update_settings").',
|
|
240
|
+
properties: {
|
|
241
|
+
adso_type: {
|
|
242
|
+
type: 'string',
|
|
243
|
+
enum: ['standard', 'staging_inbound_only', 'staging_compress', 'staging_reporting', 'datamart', 'direct_update'],
|
|
244
|
+
description: 'aDSO type preset. Sets activateData, cubeDeltaOnly, directUpdate, isReportingObject, noAqDeletion.',
|
|
245
|
+
},
|
|
246
|
+
write_changelog: { type: 'boolean', description: 'Write change log (Standard type sub-option).' },
|
|
247
|
+
snap_shot_scenario: { type: 'boolean', description: 'Snapshot support (Standard type sub-option).' },
|
|
248
|
+
unique_data_records: { type: 'boolean', description: 'Unique records (Standard type sub-option).' },
|
|
249
|
+
planning_mode: { type: 'boolean', description: 'Planning enabled.' },
|
|
250
|
+
write_interface: { type: 'boolean', description: 'Enable or disable write interface (pushMode).' },
|
|
251
|
+
label: { type: 'string', description: 'aDSO description text.' },
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
transport: {
|
|
255
|
+
type: 'string',
|
|
256
|
+
description: 'Transport request number (e.g. DEVK900123). Only required if the BW system requires transport assignment.',
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
required: ['adso_name'],
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: 'bw_create_infoobject',
|
|
264
|
+
description: 'Create a new InfoObject — Characteristic (CHA) or Key Figure (KYF) — inactive. ' +
|
|
265
|
+
'Sequence: lock → POST create → unlock. ' +
|
|
266
|
+
'After creation call bw_activate with object_type "iobj" to activate.',
|
|
267
|
+
inputSchema: {
|
|
268
|
+
type: 'object',
|
|
269
|
+
properties: {
|
|
270
|
+
infoobject_type: {
|
|
271
|
+
type: 'string',
|
|
272
|
+
enum: ['CHA', 'KYF'],
|
|
273
|
+
description: 'InfoObject type: CHA (Characteristic) or KYF (Key Figure). Default "CHA".',
|
|
274
|
+
},
|
|
275
|
+
name: {
|
|
276
|
+
type: 'string',
|
|
277
|
+
description: 'InfoObject name, max 9 characters (e.g. "IOBJ_NAME").',
|
|
278
|
+
},
|
|
279
|
+
info_area: {
|
|
280
|
+
type: 'string',
|
|
281
|
+
description: 'InfoArea to assign the InfoObject to (e.g. "NEXTJUICE").',
|
|
282
|
+
},
|
|
283
|
+
description: {
|
|
284
|
+
type: 'string',
|
|
285
|
+
description: 'Short and long description text.',
|
|
286
|
+
},
|
|
287
|
+
// CHA-specific
|
|
288
|
+
data_type: {
|
|
289
|
+
type: 'string',
|
|
290
|
+
enum: ['CHAR', 'NUMC', 'DATS', 'TIMS', 'SNUMC'],
|
|
291
|
+
description: 'CHA only. ABAP data type. Default "CHAR".',
|
|
292
|
+
},
|
|
293
|
+
length: {
|
|
294
|
+
type: 'number',
|
|
295
|
+
description: 'CHA only. Field length. Default 10.',
|
|
296
|
+
},
|
|
297
|
+
conversion_routine: {
|
|
298
|
+
type: 'string',
|
|
299
|
+
description: 'CHA only. Conversion routine (e.g. "ALPHA"). Default "ALPHA" for CHAR/NUMC, "" for others.',
|
|
300
|
+
},
|
|
301
|
+
with_master_data: {
|
|
302
|
+
type: 'boolean',
|
|
303
|
+
description: 'CHA only. Generate master data tables. Default false.',
|
|
304
|
+
},
|
|
305
|
+
with_texts: {
|
|
306
|
+
type: 'boolean',
|
|
307
|
+
description: 'CHA only. Generate text tables. Default false.',
|
|
308
|
+
},
|
|
309
|
+
referenced_infoobject: {
|
|
310
|
+
type: 'string',
|
|
311
|
+
description: 'CHA only. Reference to an existing InfoObject (e.g. "IOBJ_NAME"). Omit withMasterData/withTexts — they are inherited. Default "".',
|
|
312
|
+
},
|
|
313
|
+
compound_infoobjects: {
|
|
314
|
+
type: 'array',
|
|
315
|
+
items: { type: 'string' },
|
|
316
|
+
description: 'Technical names of the compound parent InfoObjects, in order. CHA only. Example: ["COMPND_IOBJ_NAME"].',
|
|
317
|
+
},
|
|
318
|
+
// KYF-specific
|
|
319
|
+
object_specific_data_type: {
|
|
320
|
+
type: 'string',
|
|
321
|
+
enum: ['DEC', 'CURR', 'FLTP', 'QUAN', 'DATS', 'INT4', 'INT8', 'TIMS'],
|
|
322
|
+
description: 'KYF only. Data type. Default "DEC". keyfigureType and semantics are derived automatically.',
|
|
323
|
+
},
|
|
324
|
+
aggregation_type: {
|
|
325
|
+
type: 'string',
|
|
326
|
+
enum: ['SUM', 'MAX', 'MIN'],
|
|
327
|
+
description: 'KYF only. Aggregation type. Default "SUM".',
|
|
328
|
+
},
|
|
329
|
+
fixed_unit: {
|
|
330
|
+
type: 'string',
|
|
331
|
+
description: 'Fixed unit of measure for QUAN key figures (e.g. "KWH", "M3"). Required when object_specific_data_type is QUAN.',
|
|
332
|
+
},
|
|
333
|
+
fixed_currency: {
|
|
334
|
+
type: 'string',
|
|
335
|
+
description: 'Fixed currency for CURR key figures (e.g. "EUR"). Required when object_specific_data_type is CURR.',
|
|
336
|
+
},
|
|
337
|
+
// common
|
|
338
|
+
package: {
|
|
339
|
+
type: 'string',
|
|
340
|
+
description: 'Development package. Default "$TMP".',
|
|
341
|
+
},
|
|
342
|
+
transport: {
|
|
343
|
+
type: 'string',
|
|
344
|
+
description: 'Transport request number (e.g. DEVK900123). Only required if the BW system requires transport assignment.',
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
required: ['name', 'info_area', 'description'],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: 'bw_create_infoarea',
|
|
352
|
+
description: 'Create a new InfoArea. The InfoArea is immediately active after creation — no activation step needed.',
|
|
353
|
+
inputSchema: {
|
|
354
|
+
type: 'object',
|
|
355
|
+
properties: {
|
|
356
|
+
name: {
|
|
357
|
+
type: 'string',
|
|
358
|
+
description: 'InfoArea name, max 12 characters (e.g. "NEXTJUICE").',
|
|
359
|
+
},
|
|
360
|
+
parent_info_area: {
|
|
361
|
+
type: 'string',
|
|
362
|
+
description: 'Parent InfoArea name. Omit to create at root level.',
|
|
363
|
+
},
|
|
364
|
+
description: {
|
|
365
|
+
type: 'string',
|
|
366
|
+
description: 'Description text for the InfoArea.',
|
|
367
|
+
},
|
|
368
|
+
package: {
|
|
369
|
+
type: 'string',
|
|
370
|
+
description: 'Development package. Default "$TMP".',
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
required: ['name'],
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: 'bw_create_transformation',
|
|
378
|
+
description: 'Create a new Transformation between two BW objects (aDSO, DataSource, InfoSource, etc.). ' +
|
|
379
|
+
'The Transformation name is server-generated (32-char UUID-like key). ' +
|
|
380
|
+
'Created inactive — call bw_activate with object_type "trfn" afterwards.',
|
|
381
|
+
inputSchema: {
|
|
382
|
+
type: 'object',
|
|
383
|
+
properties: {
|
|
384
|
+
source_object_type: {
|
|
385
|
+
type: 'string',
|
|
386
|
+
description: 'Source object type. Valid values: HCPR (CompositeProvider), ADSO (aDSO), RSDS (DataSource — requires source_system), HAAP (HANA Analysis Process), IOBJ (InfoObject), TRCS (InfoSource), QVIW (Query).',
|
|
387
|
+
},
|
|
388
|
+
source_object_name: {
|
|
389
|
+
type: 'string',
|
|
390
|
+
description: 'Technical name of the source object.',
|
|
391
|
+
},
|
|
392
|
+
target_object_type: {
|
|
393
|
+
type: 'string',
|
|
394
|
+
description: 'Target object type. Valid values: ADSO (aDSO), IOBJ (InfoObject), TRCS (InfoSource), DEST (Open Hub Destination).',
|
|
395
|
+
},
|
|
396
|
+
target_object_name: {
|
|
397
|
+
type: 'string',
|
|
398
|
+
description: 'Technical name of the target object.',
|
|
399
|
+
},
|
|
400
|
+
package: {
|
|
401
|
+
type: 'string',
|
|
402
|
+
description: 'Development package. Default "$TMP".',
|
|
403
|
+
},
|
|
404
|
+
source_system: {
|
|
405
|
+
type: 'string',
|
|
406
|
+
description: 'Source system name. Required when source_object_type is RSDS (DataSource).',
|
|
407
|
+
},
|
|
408
|
+
copy_from_transformation: {
|
|
409
|
+
type: 'string',
|
|
410
|
+
description: 'Technical name of an existing Transformation to copy rules from.',
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
required: ['source_object_type', 'source_object_name', 'target_object_type', 'target_object_name'],
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: 'bw_move_object',
|
|
418
|
+
description: 'Move a BW object (aDSO, InfoObject, InfoArea, …) to a different InfoArea. ' +
|
|
419
|
+
'Single POST operation — no lock/unlock needed.',
|
|
420
|
+
inputSchema: {
|
|
421
|
+
type: 'object',
|
|
422
|
+
properties: {
|
|
423
|
+
object_type: {
|
|
424
|
+
type: 'string',
|
|
425
|
+
description: 'BW object type URL segment (e.g. "adso", "iobj", "area").',
|
|
426
|
+
},
|
|
427
|
+
object_name: {
|
|
428
|
+
type: 'string',
|
|
429
|
+
description: 'Technical name of the object to move (e.g. "OBJECT_NAME").',
|
|
430
|
+
},
|
|
431
|
+
target_info_area: {
|
|
432
|
+
type: 'string',
|
|
433
|
+
description: 'Technical name of the target InfoArea (e.g. "MCPBW").',
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
required: ['object_type', 'object_name', 'target_info_area'],
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: 'bw_get_infoobject',
|
|
441
|
+
description: 'Read an InfoObject definition (must already exist in the system). Returns the full XML including data type, length, conversion routine, and descriptions.',
|
|
442
|
+
inputSchema: {
|
|
443
|
+
type: 'object',
|
|
444
|
+
properties: {
|
|
445
|
+
infoobject_name: {
|
|
446
|
+
type: 'string',
|
|
447
|
+
description: 'InfoObject name (e.g. "IOBJ_NAME").',
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
required: ['infoobject_name'],
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: 'bw_update_infoobject',
|
|
455
|
+
description: 'Update a Characteristic InfoObject: change description and/or replace the attribute list. ' +
|
|
456
|
+
'Replaces all existing attributes with the supplied list (pass an empty array to remove all). ' +
|
|
457
|
+
'Also supports Key Figure (KYF) updates: set fixed_unit or fixed_currency. ' +
|
|
458
|
+
'Sequence: lock → GET → PUT → activate → unlock — all in one call.',
|
|
459
|
+
inputSchema: {
|
|
460
|
+
type: 'object',
|
|
461
|
+
properties: {
|
|
462
|
+
name: {
|
|
463
|
+
type: 'string',
|
|
464
|
+
description: 'InfoObject name (e.g. "IOBJ_NAME").',
|
|
465
|
+
},
|
|
466
|
+
description: {
|
|
467
|
+
type: 'string',
|
|
468
|
+
description: 'New short and long description text. Omit to keep existing.',
|
|
469
|
+
},
|
|
470
|
+
transport: {
|
|
471
|
+
type: 'string',
|
|
472
|
+
description: 'Workbench transport order number (e.g. "DEVK900000"). Required when object is in a non-local package.',
|
|
473
|
+
},
|
|
474
|
+
fixed_unit: {
|
|
475
|
+
type: 'string',
|
|
476
|
+
description: 'KYF only. Fixed unit of measure (e.g. "KWH", "M3"). Sets fixedUnit on a QUAN key figure.',
|
|
477
|
+
},
|
|
478
|
+
fixed_currency: {
|
|
479
|
+
type: 'string',
|
|
480
|
+
description: 'KYF only. Fixed currency (e.g. "EUR"). Sets fixedCurrency on a CURR key figure.',
|
|
481
|
+
},
|
|
482
|
+
attributes: {
|
|
483
|
+
type: 'array',
|
|
484
|
+
description: 'New attribute list. Omit or pass [] to remove all attributes.',
|
|
485
|
+
items: {
|
|
486
|
+
type: 'object',
|
|
487
|
+
properties: {
|
|
488
|
+
name: { type: 'string', description: 'Technical name of the referenced InfoObject (e.g. "ATTR_IOBJ_NAME").' },
|
|
489
|
+
type: { type: 'string', enum: ['DIS', 'NAV'], description: 'Attribute type: DIS (Display) or NAV (Navigation).' },
|
|
490
|
+
time_dependent: { type: 'boolean', description: 'Time-dependent attribute (NAV only, default false).' },
|
|
491
|
+
display_in_query: { type: 'boolean', description: 'Display in query (default true).' },
|
|
492
|
+
use_text_of_original_characteristic: { type: 'boolean', description: 'Use text of original characteristic (default true).' },
|
|
493
|
+
},
|
|
494
|
+
required: ['name', 'type'],
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
required: ['name'],
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: 'bw_get_transformation',
|
|
503
|
+
description: 'Read a Transformation structure — source/target segments, mapping rules. ' +
|
|
504
|
+
'Transformation names are UUID-like generated keys (e.g. "TRFN_UUID_KEY"). ' +
|
|
505
|
+
'Use bw_xref on the aDSO to find the transformation name.',
|
|
506
|
+
inputSchema: {
|
|
507
|
+
type: 'object',
|
|
508
|
+
properties: {
|
|
509
|
+
transformation_name: {
|
|
510
|
+
type: 'string',
|
|
511
|
+
description: 'Transformation name (UUID-like key, e.g. "TRFN_UUID_KEY").',
|
|
512
|
+
},
|
|
513
|
+
format: {
|
|
514
|
+
type: 'string',
|
|
515
|
+
enum: ['text', 'raw'],
|
|
516
|
+
description: 'Output format. "text" (default): compact human-readable summary. "raw": raw XML from BW.',
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
required: ['transformation_name'],
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: 'bw_update_transformation',
|
|
524
|
+
description: 'Map a source field to a target InfoObject in a Transformation, or convert an existing rule to a field routine (StepRoutine) or formula rule (StepFormula). ' +
|
|
525
|
+
'rule_type="direct" (default): changes a StepNoUpdate/StepInitial rule to StepDirect. ' +
|
|
526
|
+
'rule_type="routine": converts an existing StepDirect, StepInitial, or StepNoUpdate rule to StepRoutine (AMDP field routine). ' +
|
|
527
|
+
'rule_type="formula": converts an existing rule to StepFormula — no ABAP class generated, BW evaluates the formula natively. ' +
|
|
528
|
+
'rule_type="constant": sets a fixed constant value on the target field — no source field needed. ' +
|
|
529
|
+
'For routine/formula on StepNoUpdate rules, source_field is required. ' +
|
|
530
|
+
'For routine/formula on StepDirect/StepInitial rules, source_field is ignored (field is already mapped). ' +
|
|
531
|
+
'source_field is always ignored for rule_type="constant". ' +
|
|
532
|
+
'Returns a lock_handle for bw_activate.',
|
|
533
|
+
inputSchema: {
|
|
534
|
+
type: 'object',
|
|
535
|
+
properties: {
|
|
536
|
+
transformation_name: {
|
|
537
|
+
type: 'string',
|
|
538
|
+
description: 'Transformation name (UUID-like key).',
|
|
539
|
+
},
|
|
540
|
+
source_field: {
|
|
541
|
+
type: 'string',
|
|
542
|
+
description: 'Source field name in the source segment (e.g. "FIELD_NAME"). ' +
|
|
543
|
+
'Required for rule_type="direct" if the existing rule has no source mapping. ' +
|
|
544
|
+
'Also required for routine/formula when the target has no source mapping yet (StepNoUpdate). ' +
|
|
545
|
+
'Required for rule_type="lookup".',
|
|
546
|
+
},
|
|
547
|
+
target_infoobject: {
|
|
548
|
+
type: 'string',
|
|
549
|
+
description: 'Target InfoObject name in the target segment (e.g. "IOBJ_NAME").',
|
|
550
|
+
},
|
|
551
|
+
rule_type: {
|
|
552
|
+
type: 'string',
|
|
553
|
+
enum: ['direct', 'routine', 'formula', 'constant', 'lookup', 'no_update'],
|
|
554
|
+
description: 'Rule type to assign. "direct" (default): maps source field directly (StepDirect). ' +
|
|
555
|
+
'"routine": converts the rule to an AMDP field routine (StepRoutine) — the server generates the ABAP class automatically. ' +
|
|
556
|
+
'"formula": converts the rule to a formula rule (StepFormula) — requires the formula parameter. ' +
|
|
557
|
+
'"constant": sets a fixed constant value (StepConstant) — requires the constant_value parameter, source_field is ignored. ' +
|
|
558
|
+
'"lookup": converts the rule to a StepRead (Lookup) rule — requires lookup_object and lookup_object_type. ' +
|
|
559
|
+
'"no_update": reverts any existing mapping back to StepNoUpdate (no mapping, field stays empty). ' +
|
|
560
|
+
'IMPORTANT: AMDP SQLSCRIPT methods only allow ASCII 7-bit characters — no German umlauts or special symbols in code or comments.',
|
|
561
|
+
},
|
|
562
|
+
formula: {
|
|
563
|
+
type: 'string',
|
|
564
|
+
description: 'Formula expression for rule_type="formula" (required). ' +
|
|
565
|
+
'Source fields are referenced by their technical field name: use /BIC/FIELDNAME for custom InfoObjects (e.g. "/BIC/FIELD_NAME + 10"), ' +
|
|
566
|
+
'or the direct field name for standard InfoObjects. ' +
|
|
567
|
+
'Operators: +, -, *, /. Functions: IF, ABS, CONCATENATE, DATE_YEAR, etc. ' +
|
|
568
|
+
'Comparison operators < > <= >= <> are supported (will be XML-escaped automatically).',
|
|
569
|
+
},
|
|
570
|
+
constant_value: {
|
|
571
|
+
type: 'string',
|
|
572
|
+
description: 'Constant value for rule_type="constant" (required). ' +
|
|
573
|
+
'The value is written as-is into the target field during data loading. ' +
|
|
574
|
+
'Example: "X" for a flag field, "USD" for a currency field.',
|
|
575
|
+
},
|
|
576
|
+
lookup_object: {
|
|
577
|
+
type: 'string',
|
|
578
|
+
description: 'Name of the InfoObject or aDSO to read from (Nachlese-Objekt). Required for rule_type="lookup".',
|
|
579
|
+
},
|
|
580
|
+
lookup_object_type: {
|
|
581
|
+
type: 'string',
|
|
582
|
+
enum: ['IOBJ', 'ADSO'],
|
|
583
|
+
description: 'Type of the lookup object. "IOBJ" for InfoObject, "ADSO" for aDSO. Required for rule_type="lookup".',
|
|
584
|
+
},
|
|
585
|
+
additional_source_fields: {
|
|
586
|
+
type: 'array',
|
|
587
|
+
items: { type: 'string' },
|
|
588
|
+
description: 'Additional source fields for rule_type="formula" when the formula references more than one source field. ' +
|
|
589
|
+
'Combined with source_field, all listed fields are registered as inputs on the StepFormula rule. ' +
|
|
590
|
+
'Example: ["QUANTITY_SOLD", "COST_PER_UNIT"].',
|
|
591
|
+
},
|
|
592
|
+
transport: {
|
|
593
|
+
type: 'string',
|
|
594
|
+
description: 'Transport request number (e.g. DEVK900123). Only required if the BW system requires transport assignment.',
|
|
595
|
+
},
|
|
596
|
+
},
|
|
597
|
+
required: ['transformation_name', 'target_infoobject'],
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
name: 'bw_delete_transformation_routine',
|
|
602
|
+
description: 'Remove a Start, End, or Expert routine from a Transformation. ' +
|
|
603
|
+
'Deletes the matching rule from group id="0". If no rules remain, removes the entire group. ' +
|
|
604
|
+
'Returns lock_handle for bw_activate.',
|
|
605
|
+
inputSchema: {
|
|
606
|
+
type: 'object',
|
|
607
|
+
properties: {
|
|
608
|
+
transformation_name: {
|
|
609
|
+
type: 'string',
|
|
610
|
+
description: 'Transformation name (UUID-like key).',
|
|
611
|
+
},
|
|
612
|
+
routine_type: {
|
|
613
|
+
type: 'string',
|
|
614
|
+
enum: ['start', 'end', 'expert'],
|
|
615
|
+
description: 'Routine to remove: "start", "end", or "expert".',
|
|
616
|
+
},
|
|
617
|
+
},
|
|
618
|
+
required: ['transformation_name', 'routine_type'],
|
|
619
|
+
},
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
name: 'bw_set_transformation_routine',
|
|
623
|
+
description: 'Add a Start, End, or Expert routine to a Transformation. ' +
|
|
624
|
+
'Creates the global routine group (group id="0") and ABAP/AMDP method stub. ' +
|
|
625
|
+
'Returns lock_handle for bw_activate.',
|
|
626
|
+
inputSchema: {
|
|
627
|
+
type: 'object',
|
|
628
|
+
properties: {
|
|
629
|
+
transformation_name: {
|
|
630
|
+
type: 'string',
|
|
631
|
+
description: 'Transformation name (UUID-like key).',
|
|
632
|
+
},
|
|
633
|
+
routine_type: {
|
|
634
|
+
type: 'string',
|
|
635
|
+
enum: ['start', 'end', 'expert'],
|
|
636
|
+
description: '"start" → GLOBAL_START, "end" → GLOBAL_END, "expert" → GLOBAL_EXPERT.',
|
|
637
|
+
},
|
|
638
|
+
transport: {
|
|
639
|
+
type: 'string',
|
|
640
|
+
description: 'Transport request number (e.g. DEVK900123). Only required if the BW system requires transport assignment.',
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
required: ['transformation_name', 'routine_type'],
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
name: 'bw_set_transformation_runtime',
|
|
648
|
+
description: 'Switch a Transformation between HANA and ABAP runtime. ' +
|
|
649
|
+
'Only changes the HANARuntime attribute — no rule changes. ' +
|
|
650
|
+
'If the runtime already matches the target value, returns early without a PUT. ' +
|
|
651
|
+
'Returns a lock_handle for bw_activate.',
|
|
652
|
+
inputSchema: {
|
|
653
|
+
type: 'object',
|
|
654
|
+
properties: {
|
|
655
|
+
transformation_name: {
|
|
656
|
+
type: 'string',
|
|
657
|
+
description: 'Transformation name (UUID-like key).',
|
|
658
|
+
},
|
|
659
|
+
runtime: {
|
|
660
|
+
type: 'string',
|
|
661
|
+
enum: ['hana', 'abap'],
|
|
662
|
+
description: '"hana" sets HANARuntime="true", "abap" sets HANARuntime="false".',
|
|
663
|
+
},
|
|
664
|
+
transport: {
|
|
665
|
+
type: 'string',
|
|
666
|
+
description: 'Transport request number (e.g. DEVK900123). Only required if the BW system requires transport assignment.',
|
|
667
|
+
},
|
|
668
|
+
},
|
|
669
|
+
required: ['transformation_name', 'runtime'],
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
name: 'bw_activate',
|
|
674
|
+
description: 'Activate one BW object (aDSO, Transformation, DTP, InfoObject, InfoSource, or DataSource). ' +
|
|
675
|
+
'Pass the lock_handle from bw_update_adso or bw_update_transformation. ' +
|
|
676
|
+
'For DTP and DataSource (rsds) activation use lock_handle="" (no lock needed — standalone activation). ' +
|
|
677
|
+
'For object_type "rsds" also pass source_system (a DataSource is identified by DataSource name plus source system). ' +
|
|
678
|
+
'Unlock is sent automatically after activation (not for DTPs or DataSources). ' +
|
|
679
|
+
'The response lists any DTPs deactivated by impact analysis — these must be re-activated.',
|
|
680
|
+
inputSchema: {
|
|
681
|
+
type: 'object',
|
|
682
|
+
properties: {
|
|
683
|
+
object_type: {
|
|
684
|
+
type: 'string',
|
|
685
|
+
enum: ['adso', 'trfn', 'dtpa', 'iobj', 'trcs', 'rsds'],
|
|
686
|
+
description: 'Object type: adso, trfn, dtpa, iobj, trcs, or rsds (DataSource).',
|
|
687
|
+
},
|
|
688
|
+
object_name: {
|
|
689
|
+
type: 'string',
|
|
690
|
+
description: 'Object name (e.g. "OBJECT_NAME" or "DTP_..."). For rsds, the DataSource name.',
|
|
691
|
+
},
|
|
692
|
+
lock_handle: {
|
|
693
|
+
type: 'string',
|
|
694
|
+
description: 'Lock handle from bw_update_adso or bw_update_transformation. ' +
|
|
695
|
+
'Use empty string "" for DTP and DataSource (rsds) activation.',
|
|
696
|
+
},
|
|
697
|
+
source_system: {
|
|
698
|
+
type: 'string',
|
|
699
|
+
description: 'Source system name. Required when object_type is "rsds" (e.g. "LSYS_NAME").',
|
|
700
|
+
},
|
|
701
|
+
transport: {
|
|
702
|
+
type: 'string',
|
|
703
|
+
description: 'Transport request number. Required on systems with transport obligation.',
|
|
704
|
+
},
|
|
705
|
+
},
|
|
706
|
+
required: ['object_type', 'object_name', 'lock_handle'],
|
|
707
|
+
},
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
name: 'bw_delete',
|
|
711
|
+
description: 'Delete a BW object permanently (aDSO, InfoObject, Transformation, DTP, etc.). ' +
|
|
712
|
+
'Sequence: lock (with /m) → DELETE → unlock. No activation needed — deletion is immediate. ' +
|
|
713
|
+
'Dependency note: delete aDSOs before their InfoObjects, not the other way around.',
|
|
714
|
+
inputSchema: {
|
|
715
|
+
type: 'object',
|
|
716
|
+
properties: {
|
|
717
|
+
object_type: {
|
|
718
|
+
type: 'string',
|
|
719
|
+
description: 'BW object type: adso, iobj, trfn, dtpa, etc.',
|
|
720
|
+
},
|
|
721
|
+
object_name: {
|
|
722
|
+
type: 'string',
|
|
723
|
+
description: 'Technical object name (e.g. "OBJECT_NAME").',
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
required: ['object_type', 'object_name'],
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
name: 'bw_unlock',
|
|
731
|
+
description: 'Release a lock on a BW object without activating it. ' +
|
|
732
|
+
'Use this to discard changes and free the lock, e.g. after an aborted create or update. ' +
|
|
733
|
+
'DTPs do not need unlocking.',
|
|
734
|
+
inputSchema: {
|
|
735
|
+
type: 'object',
|
|
736
|
+
properties: {
|
|
737
|
+
object_type: {
|
|
738
|
+
type: 'string',
|
|
739
|
+
enum: ['adso', 'trfn', 'trcs', 'iobj', 'area'],
|
|
740
|
+
description: 'Object type: adso, trfn, trcs, iobj, or area (InfoArea).',
|
|
741
|
+
},
|
|
742
|
+
object_name: {
|
|
743
|
+
type: 'string',
|
|
744
|
+
description: 'Object name (e.g. "OBJECT_NAME").',
|
|
745
|
+
},
|
|
746
|
+
},
|
|
747
|
+
required: ['object_type', 'object_name'],
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
name: 'bw_get_infosource',
|
|
752
|
+
description: 'Read an InfoSource (TRCS) structure — fields, key fields, label, InfoArea, version status.',
|
|
753
|
+
inputSchema: {
|
|
754
|
+
type: 'object',
|
|
755
|
+
properties: {
|
|
756
|
+
name: {
|
|
757
|
+
type: 'string',
|
|
758
|
+
description: 'InfoSource name (e.g. "INFOSOURCE_NAME").',
|
|
759
|
+
},
|
|
760
|
+
},
|
|
761
|
+
required: ['name'],
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
name: 'bw_get_infoarea',
|
|
766
|
+
description: 'Read an InfoArea definition — name, label, parent area, object status.',
|
|
767
|
+
inputSchema: {
|
|
768
|
+
type: 'object',
|
|
769
|
+
properties: {
|
|
770
|
+
name: {
|
|
771
|
+
type: 'string',
|
|
772
|
+
description: 'InfoArea name (e.g. "NEXTJUICE").',
|
|
773
|
+
},
|
|
774
|
+
},
|
|
775
|
+
required: ['name'],
|
|
776
|
+
},
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
name: 'bw_create_infosource',
|
|
780
|
+
description: 'Create a new InfoSource (TRCS) shell. ' +
|
|
781
|
+
'Optionally copy fields from an existing aDSO, CompositeProvider, DataSource, or InfoObject via copy_from_* parameters. ' +
|
|
782
|
+
'Created inactive — call bw_activate with object_type "trcs" afterwards. ' +
|
|
783
|
+
'To add fields after creation use bw_update_infosource.',
|
|
784
|
+
inputSchema: {
|
|
785
|
+
type: 'object',
|
|
786
|
+
properties: {
|
|
787
|
+
name: {
|
|
788
|
+
type: 'string',
|
|
789
|
+
description: 'InfoSource name (e.g. "INFOSOURCE_NAME").',
|
|
790
|
+
},
|
|
791
|
+
description: {
|
|
792
|
+
type: 'string',
|
|
793
|
+
description: 'Description / label for the InfoSource.',
|
|
794
|
+
},
|
|
795
|
+
info_area: {
|
|
796
|
+
type: 'string',
|
|
797
|
+
description: 'InfoArea to create the InfoSource in (e.g. "MCPBW").',
|
|
798
|
+
},
|
|
799
|
+
package: {
|
|
800
|
+
type: 'string',
|
|
801
|
+
description: 'Development package (default "$TMP").',
|
|
802
|
+
},
|
|
803
|
+
copy_from_object_name: {
|
|
804
|
+
type: 'string',
|
|
805
|
+
description: 'Technical name of the source object to copy fields from. Required when copy_from_object_type is set.',
|
|
806
|
+
},
|
|
807
|
+
copy_from_object_type: {
|
|
808
|
+
type: 'string',
|
|
809
|
+
enum: ['ADSO', 'HCPR', 'RSDS', 'IOBJ'],
|
|
810
|
+
description: 'Type of the source object: ADSO (aDSO), HCPR (CompositeProvider), RSDS (DataSource), IOBJ (InfoObject).',
|
|
811
|
+
},
|
|
812
|
+
copy_from_object_sub_type: {
|
|
813
|
+
type: 'string',
|
|
814
|
+
enum: ['ATTR', 'TEXT', 'HIER'],
|
|
815
|
+
description: 'SubType for IOBJ only: ATTR (Attribute), TEXT (Text), HIER (Hierarchy).',
|
|
816
|
+
},
|
|
817
|
+
copy_from_source_system: {
|
|
818
|
+
type: 'string',
|
|
819
|
+
description: 'Source system name (required when copy_from_object_type is RSDS, e.g. "PC_FILE").',
|
|
820
|
+
},
|
|
821
|
+
},
|
|
822
|
+
required: ['name', 'description', 'info_area'],
|
|
823
|
+
},
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
name: 'bw_update_infosource',
|
|
827
|
+
description: 'Update an InfoSource — change description and/or replace the complete field list. ' +
|
|
828
|
+
'Provide fields as an array; the entire existing field list is replaced. ' +
|
|
829
|
+
'Each field can reference an InfoObject (set infoobject_name) or be a local field (omit infoobject_name). ' +
|
|
830
|
+
'Returns a lock_handle for bw_activate.',
|
|
831
|
+
inputSchema: {
|
|
832
|
+
type: 'object',
|
|
833
|
+
properties: {
|
|
834
|
+
name: {
|
|
835
|
+
type: 'string',
|
|
836
|
+
description: 'InfoSource name (e.g. "INFOSOURCE_NAME").',
|
|
837
|
+
},
|
|
838
|
+
description: {
|
|
839
|
+
type: 'string',
|
|
840
|
+
description: 'New description text (optional — omit to leave unchanged).',
|
|
841
|
+
},
|
|
842
|
+
fields: {
|
|
843
|
+
type: 'array',
|
|
844
|
+
description: 'Complete list of fields. Replaces all existing fields. Omit to leave fields unchanged.',
|
|
845
|
+
items: {
|
|
846
|
+
type: 'object',
|
|
847
|
+
properties: {
|
|
848
|
+
name: { type: 'string', description: 'Field name (uppercase).' },
|
|
849
|
+
infoobject_name: { type: 'string', description: 'InfoObject name to bind this field to (omit for local fields).' },
|
|
850
|
+
type: { type: 'string', description: 'Data type (e.g. CHAR, NUMC, DEC, CURR, DATS).' },
|
|
851
|
+
length: { type: 'number', description: 'Field length.' },
|
|
852
|
+
label: { type: 'string', description: 'Field label / description.' },
|
|
853
|
+
is_key: { type: 'boolean', description: 'If true, also adds a keyElement entry.' },
|
|
854
|
+
aggregation_behavior: {
|
|
855
|
+
type: 'string',
|
|
856
|
+
enum: ['NONE', 'SUM', 'MIN', 'MAX', 'AVG', 'LAST'],
|
|
857
|
+
description: 'Aggregation behavior (default "NONE").',
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
required: ['name', 'type', 'length', 'label'],
|
|
861
|
+
},
|
|
862
|
+
},
|
|
863
|
+
transport: {
|
|
864
|
+
type: 'string',
|
|
865
|
+
description: 'Transport request number (e.g. DEVK900123). Only required if the BW system requires transport assignment.',
|
|
866
|
+
},
|
|
867
|
+
},
|
|
868
|
+
required: ['name'],
|
|
869
|
+
},
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
name: 'bw_get_dtps',
|
|
873
|
+
description: 'List DTPs (Data Transfer Processes) that depend on a BW object. ' +
|
|
874
|
+
'Uses the xref endpoint filtered to DTPA object type. ' +
|
|
875
|
+
'Use object_type=TRFN and the transformation name to find DTPs after activating a transformation.',
|
|
876
|
+
inputSchema: {
|
|
877
|
+
type: 'object',
|
|
878
|
+
properties: {
|
|
879
|
+
object_type: {
|
|
880
|
+
type: 'string',
|
|
881
|
+
description: 'Object type of the referenced object: ADSO, TRFN, IOBJ, etc.',
|
|
882
|
+
},
|
|
883
|
+
object_name: {
|
|
884
|
+
type: 'string',
|
|
885
|
+
description: 'Object name to find dependent DTPs for.',
|
|
886
|
+
},
|
|
887
|
+
},
|
|
888
|
+
required: ['object_type', 'object_name'],
|
|
889
|
+
},
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
name: 'bw_get_dtp',
|
|
893
|
+
description: 'Read a DTP (Data Transfer Process) definition — source, target, transformation, extraction settings, and filter fields (selections and routines). ' +
|
|
894
|
+
'Use bw_xref on an aDSO to find the DTP name first. ' +
|
|
895
|
+
'To find only the process chain a DTP belongs to, use bw_xref with object_type=DTPA instead — it is faster and avoids loading the full DTP definition.',
|
|
896
|
+
inputSchema: {
|
|
897
|
+
type: 'object',
|
|
898
|
+
properties: {
|
|
899
|
+
dtp_name: {
|
|
900
|
+
type: 'string',
|
|
901
|
+
description: 'DTP name (e.g. "DTP_...").',
|
|
902
|
+
},
|
|
903
|
+
},
|
|
904
|
+
required: ['dtp_name'],
|
|
905
|
+
},
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
name: 'bw_get_process_chain',
|
|
909
|
+
description: 'Read a Process Chain (RSPC) definition — header metadata, scheduling and monitoring ' +
|
|
910
|
+
'settings, all steps (nodes) with type, variant, and last execution status, ' +
|
|
911
|
+
'step dependencies (edges) with branch conditions for DECISION nodes, ' +
|
|
912
|
+
'and inline variant details. ' +
|
|
913
|
+
'By default (include_variant_details=true), automatically fetches and embeds the full ' +
|
|
914
|
+
'variant configuration for each step that has detail available. ' +
|
|
915
|
+
'Steps without variant detail (DTP_LOAD, OR, AND, EXOR, CHAIN) are shown without extra detail — ' +
|
|
916
|
+
'for DTP_LOAD use bw_get_dtp, for CHAIN use bw_get_process_chain recursively. ' +
|
|
917
|
+
'Set include_variant_details=false for a faster structural overview without variant detail. ' +
|
|
918
|
+
'Use bw_search with object_type=PRCH to find chain names first.',
|
|
919
|
+
inputSchema: {
|
|
920
|
+
type: 'object',
|
|
921
|
+
properties: {
|
|
922
|
+
chain_name: {
|
|
923
|
+
type: 'string',
|
|
924
|
+
description: 'Process chain technical name (e.g. "CHAIN_NAME"). Case-insensitive.',
|
|
925
|
+
},
|
|
926
|
+
format: {
|
|
927
|
+
type: 'string',
|
|
928
|
+
enum: ['text', 'raw'],
|
|
929
|
+
description: 'Output format. "text" (default): compact human-readable summary. "raw": full parsed JSON.',
|
|
930
|
+
},
|
|
931
|
+
include_variant_details: {
|
|
932
|
+
type: 'boolean',
|
|
933
|
+
description: 'If true (default), fetches variant configuration detail for each step automatically and includes it inline. Set to false to skip variant detail fetching for faster response on large chains.',
|
|
934
|
+
},
|
|
935
|
+
},
|
|
936
|
+
required: ['chain_name'],
|
|
937
|
+
},
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
name: 'bw_get_process_variant',
|
|
941
|
+
description: 'Read the detail configuration of a single Process Variant from a Process Chain step. ' +
|
|
942
|
+
'Covers all process types: ABAP (report name + selection variant), ADSOACT (aDSO activation), ' +
|
|
943
|
+
'ADSOREM (request cleanup), PLSWITCHL/PLSWITCHP (planning mode switch), DTP_LOAD, ' +
|
|
944
|
+
'DECISION, and any other type — oDetail is returned as indented JSON for unknown types. ' +
|
|
945
|
+
'Get process_type and variant_name from bw_get_process_chain output (sProcessType and sProcessVariant fields). ' +
|
|
946
|
+
'Use format="raw" to see the full unformatted JSON.',
|
|
947
|
+
inputSchema: {
|
|
948
|
+
type: 'object',
|
|
949
|
+
properties: {
|
|
950
|
+
process_type: {
|
|
951
|
+
type: 'string',
|
|
952
|
+
description: 'Process type technical name from the chain step (e.g. "ABAP", "DTP_LOAD", "ADSOACT", "ADSOREM", "PLSWITCHL", "PLSWITCHP", "DECISION"). Case-insensitive.',
|
|
953
|
+
},
|
|
954
|
+
variant_name: {
|
|
955
|
+
type: 'string',
|
|
956
|
+
description: 'Process variant technical name from the chain step (e.g. "ILV_...", "DTP_...", "DEL_..."). Case-insensitive.',
|
|
957
|
+
},
|
|
958
|
+
format: {
|
|
959
|
+
type: 'string',
|
|
960
|
+
enum: ['text', 'raw'],
|
|
961
|
+
description: 'Output format. "text" (default): readable summary with oDetail as indented JSON. "raw": full parsed JSON.',
|
|
962
|
+
},
|
|
963
|
+
},
|
|
964
|
+
required: ['process_type', 'variant_name'],
|
|
965
|
+
},
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
name: 'bw_list_requests',
|
|
969
|
+
description: 'List the recent load requests of an InfoProvider from the runtime request monitor, ' +
|
|
970
|
+
'with decoded request status, record counts and timestamps. ' +
|
|
971
|
+
'Returns one entry per request including the internal request TSN, which is the ' +
|
|
972
|
+
'input for bw_get_request. Read-only. ' +
|
|
973
|
+
'Use bw_search to find the target technical name first. ' +
|
|
974
|
+
'Performance: listing cost scales with the number of returned rows because each row ' +
|
|
975
|
+
'is enriched on the backend (a per-row cross-reference read). top bounds the result set; ' +
|
|
976
|
+
'created_from and status only help by returning fewer rows, not by making a row cheaper. ' +
|
|
977
|
+
'For providers with long load histories, use a narrow created_from window or a small top.',
|
|
978
|
+
inputSchema: {
|
|
979
|
+
type: 'object',
|
|
980
|
+
properties: {
|
|
981
|
+
target: {
|
|
982
|
+
type: 'string',
|
|
983
|
+
description: 'Target InfoProvider technical name (e.g. "OBJECT_NAME"). Case-insensitive.',
|
|
984
|
+
},
|
|
985
|
+
target_type: {
|
|
986
|
+
type: 'string',
|
|
987
|
+
description: 'Target object type (default "ADSO").',
|
|
988
|
+
},
|
|
989
|
+
storage: {
|
|
990
|
+
type: 'string',
|
|
991
|
+
description: 'Comma-separated storage area codes (default "AQ,AX,AT").',
|
|
992
|
+
},
|
|
993
|
+
status: {
|
|
994
|
+
type: 'string',
|
|
995
|
+
description: 'Comma-separated request status codes to include (default "N,GG,GR,YG,RR,YR,RG,U,Y,X").',
|
|
996
|
+
},
|
|
997
|
+
created_from: {
|
|
998
|
+
type: 'string',
|
|
999
|
+
description: 'Optional server-side lower time bound, ISO 8601 with milliseconds and Z ' +
|
|
1000
|
+
'(24 chars, e.g. "YYYY-MM-DDTHH:MM:SS.000Z"). Returns only requests created at or ' +
|
|
1001
|
+
'after this time (open upper bound = now). Narrows the result set, which reduces ' +
|
|
1002
|
+
'per-row backend enrichment cost. Recommended for providers with long load histories.',
|
|
1003
|
+
},
|
|
1004
|
+
top: {
|
|
1005
|
+
type: 'number',
|
|
1006
|
+
description: 'Upper cap on the number of requests to return (default 3). Each returned row triggers ' +
|
|
1007
|
+
'an expensive per-row backend read, so keep this small; raise it only when needed.',
|
|
1008
|
+
},
|
|
1009
|
+
},
|
|
1010
|
+
required: ['target'],
|
|
1011
|
+
},
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
name: 'bw_get_request',
|
|
1015
|
+
description: 'Full status analysis of one load request in a single call, bundling the request ' +
|
|
1016
|
+
'header, DTP information (including start, finish and duration), the process step ' +
|
|
1017
|
+
'chain and the message log. Read-only. ' +
|
|
1018
|
+
'The request TSN comes from bw_list_requests output.',
|
|
1019
|
+
inputSchema: {
|
|
1020
|
+
type: 'object',
|
|
1021
|
+
properties: {
|
|
1022
|
+
request_tsn: {
|
|
1023
|
+
type: 'string',
|
|
1024
|
+
description: 'Internal request TSN from bw_list_requests output.',
|
|
1025
|
+
},
|
|
1026
|
+
storage: {
|
|
1027
|
+
type: 'string',
|
|
1028
|
+
description: 'Storage area code (default "AQ").',
|
|
1029
|
+
},
|
|
1030
|
+
format: {
|
|
1031
|
+
type: 'string',
|
|
1032
|
+
enum: ['text', 'raw'],
|
|
1033
|
+
description: 'Output format. "text" (default): readable summary. "raw": full parsed JSON of all four payloads.',
|
|
1034
|
+
},
|
|
1035
|
+
},
|
|
1036
|
+
required: ['request_tsn'],
|
|
1037
|
+
},
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
name: 'bw_activate_request',
|
|
1041
|
+
description: 'Activate loaded data (DSO request activation): move a finished load from the Inbound ' +
|
|
1042
|
+
'Table into the active data table and change log. This is the runtime request activation, ' +
|
|
1043
|
+
'NOT the modeling-object activation done by bw_activate. ' +
|
|
1044
|
+
'Only applies to aDSOs that have an activation step (not inbound-only staging aDSOs). ' +
|
|
1045
|
+
'Activates all previous loads up to the given request. ' +
|
|
1046
|
+
'Asynchronous: a successful call starts activation; monitor completion via ' +
|
|
1047
|
+
'bw_list_requests / bw_get_request.',
|
|
1048
|
+
inputSchema: {
|
|
1049
|
+
type: 'object',
|
|
1050
|
+
properties: {
|
|
1051
|
+
request_tsn: {
|
|
1052
|
+
type: 'string',
|
|
1053
|
+
description: 'Load request TSN to activate (from bw_list_requests / bw_run_dtp output).',
|
|
1054
|
+
},
|
|
1055
|
+
storage: {
|
|
1056
|
+
type: 'string',
|
|
1057
|
+
description: 'Storage area code the request lives in (default "AQ").',
|
|
1058
|
+
},
|
|
1059
|
+
},
|
|
1060
|
+
required: ['request_tsn'],
|
|
1061
|
+
},
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
name: 'bw_create_dtp',
|
|
1065
|
+
description: 'Create a new DTP (Data Transfer Process) for an existing Transformation and activate it. ' +
|
|
1066
|
+
'The DTP name is server-generated. ' +
|
|
1067
|
+
'Optionally set a filter on one source field (Equal operator). ' +
|
|
1068
|
+
'After creation the DTP is activated automatically. ' +
|
|
1069
|
+
'IMPORTANT: Before calling this tool, always check the full transformation chain. ' +
|
|
1070
|
+
'Single-step chain (e.g. ADSO->ADSO): use trfn_name only. ' +
|
|
1071
|
+
'Two-step chain (e.g. ADSO->TRCS->ADSO): use trfn_name for the first transformation and trfn_name_2 for the second; ' +
|
|
1072
|
+
'source_name/source_type = the start object, target_name/target_type = the end object. ' +
|
|
1073
|
+
'Omitting trfn_name_2 in a two-step chain causes a persistent HTTP 500 error. ' +
|
|
1074
|
+
'Use bw_get_transformation or bw_xref to determine the chain before creating the DTP. ' +
|
|
1075
|
+
'DataSource source: set source_type "RSDS" and pass source_system (the DataSource source system). ' +
|
|
1076
|
+
'source_name is then the plain DataSource name; the tool builds the RSDS compound source key internally.',
|
|
1077
|
+
inputSchema: {
|
|
1078
|
+
type: 'object',
|
|
1079
|
+
properties: {
|
|
1080
|
+
trfn_name: {
|
|
1081
|
+
type: 'string',
|
|
1082
|
+
description: 'Technical name of the existing Transformation (UUID-like key).',
|
|
1083
|
+
},
|
|
1084
|
+
trfn_name_2: {
|
|
1085
|
+
type: 'string',
|
|
1086
|
+
description: 'Optional second transformation in a multi-step chain. Include when the DTP spans two transformations (e.g. ADSO→TRCS→ADSO).',
|
|
1087
|
+
},
|
|
1088
|
+
source_name: {
|
|
1089
|
+
type: 'string',
|
|
1090
|
+
description: 'Source object name (e.g. "SOURCE_NAME").',
|
|
1091
|
+
},
|
|
1092
|
+
source_type: {
|
|
1093
|
+
type: 'string',
|
|
1094
|
+
description: 'Source object type (e.g. "ADSO", "TRCS", "RSDS"). Use "RSDS" for a DataSource source — source_system is then required.',
|
|
1095
|
+
},
|
|
1096
|
+
source_system: {
|
|
1097
|
+
type: 'string',
|
|
1098
|
+
description: 'Source system name of the DataSource. Required when source_type is "RSDS".',
|
|
1099
|
+
},
|
|
1100
|
+
target_name: {
|
|
1101
|
+
type: 'string',
|
|
1102
|
+
description: 'Target object name (e.g. "TARGET_NAME").',
|
|
1103
|
+
},
|
|
1104
|
+
target_type: {
|
|
1105
|
+
type: 'string',
|
|
1106
|
+
description: 'Target object type (e.g. "ADSO").',
|
|
1107
|
+
},
|
|
1108
|
+
description: {
|
|
1109
|
+
type: 'string',
|
|
1110
|
+
description: 'Optional DTP description text (default: empty).',
|
|
1111
|
+
},
|
|
1112
|
+
package: {
|
|
1113
|
+
type: 'string',
|
|
1114
|
+
description: 'Development package (default "$TMP").',
|
|
1115
|
+
},
|
|
1116
|
+
filter_field: {
|
|
1117
|
+
type: 'string',
|
|
1118
|
+
description: 'Field name to filter on. Requires filter_dta_name and filter_value.',
|
|
1119
|
+
},
|
|
1120
|
+
filter_dta_name: {
|
|
1121
|
+
type: 'string',
|
|
1122
|
+
description: 'Internal dtaName for the filter field.',
|
|
1123
|
+
},
|
|
1124
|
+
filter_value: {
|
|
1125
|
+
type: 'string',
|
|
1126
|
+
description: 'Filter value for the Equal selection (e.g. "PL_001").',
|
|
1127
|
+
},
|
|
1128
|
+
},
|
|
1129
|
+
required: ['trfn_name', 'source_name', 'source_type', 'target_name', 'target_type'],
|
|
1130
|
+
},
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
name: 'bw_run_dtp',
|
|
1134
|
+
description: 'Start (execute) a run of an existing, active DTP. ' +
|
|
1135
|
+
'Triggers the load with a single request and returns the new run request id. ' +
|
|
1136
|
+
'The returned request_id is the RSPM request TSN: pass it straight into ' +
|
|
1137
|
+
'bw_get_request (as request_tsn) to monitor load status — no bw_list_requests lookup needed.',
|
|
1138
|
+
inputSchema: {
|
|
1139
|
+
type: 'object',
|
|
1140
|
+
properties: {
|
|
1141
|
+
dtp_name: {
|
|
1142
|
+
type: 'string',
|
|
1143
|
+
description: 'Technical name of the DTP to run (e.g. "DTP_...").',
|
|
1144
|
+
},
|
|
1145
|
+
},
|
|
1146
|
+
required: ['dtp_name'],
|
|
1147
|
+
},
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
name: 'bw_set_dtp_filter_routine',
|
|
1151
|
+
description: 'Set an ABAP filter routine on a DTP filter field. Use this only when custom ABAP code is needed for the filter logic, not for simple value filters.',
|
|
1152
|
+
inputSchema: {
|
|
1153
|
+
type: 'object',
|
|
1154
|
+
properties: {
|
|
1155
|
+
dtp_name: {
|
|
1156
|
+
type: 'string',
|
|
1157
|
+
description: 'DTP name (e.g. "DTP_...").',
|
|
1158
|
+
},
|
|
1159
|
+
field_name: {
|
|
1160
|
+
type: 'string',
|
|
1161
|
+
description: 'Filter field name as it appears in the DTP XML fields element.',
|
|
1162
|
+
},
|
|
1163
|
+
routine_code: {
|
|
1164
|
+
type: 'string',
|
|
1165
|
+
description: 'ABAP routine code (plain text, without FORM/ENDFORM wrapper).',
|
|
1166
|
+
},
|
|
1167
|
+
global_code: {
|
|
1168
|
+
type: 'string',
|
|
1169
|
+
description: 'Optional global declarations for the routine.',
|
|
1170
|
+
},
|
|
1171
|
+
},
|
|
1172
|
+
required: ['dtp_name', 'field_name', 'routine_code'],
|
|
1173
|
+
},
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
name: 'bw_update_dtp',
|
|
1177
|
+
description: 'Update DTP properties: description, simple value filter (e.g. field = value), and/or extraction mode (Full vs Delta). Use this for setting filter values on existing filter fields. ' +
|
|
1178
|
+
'Note: switching extraction mode between Delta and Full (and back) has BW delta-init implications — a later delta load may require re-initialization of the delta on the source.',
|
|
1179
|
+
inputSchema: {
|
|
1180
|
+
type: 'object',
|
|
1181
|
+
properties: {
|
|
1182
|
+
dtp_name: {
|
|
1183
|
+
type: 'string',
|
|
1184
|
+
description: 'DTP name to update (e.g. "DTP_...").',
|
|
1185
|
+
},
|
|
1186
|
+
description: {
|
|
1187
|
+
type: 'string',
|
|
1188
|
+
description: 'New description text for the DTP.',
|
|
1189
|
+
},
|
|
1190
|
+
filter_field: {
|
|
1191
|
+
type: 'string',
|
|
1192
|
+
description: 'Field name to filter on. Requires filter_value.',
|
|
1193
|
+
},
|
|
1194
|
+
filter_dta_name: {
|
|
1195
|
+
type: 'string',
|
|
1196
|
+
description: 'Internal dtaName for the filter field. Reserved for future use.',
|
|
1197
|
+
},
|
|
1198
|
+
filter_value: {
|
|
1199
|
+
type: 'string',
|
|
1200
|
+
description: 'Filter value(s) for the selection. Comma-separated for multiple values (e.g. "VAL1,VAL2").',
|
|
1201
|
+
},
|
|
1202
|
+
filter_excluding: {
|
|
1203
|
+
type: 'boolean',
|
|
1204
|
+
description: 'If true, the filter excludes the given values (excluding="true"). Default false (inclusive).',
|
|
1205
|
+
},
|
|
1206
|
+
filter_clear_fields: {
|
|
1207
|
+
type: 'string',
|
|
1208
|
+
description: 'Comma-separated list of field names whose filter selections should be removed entirely.',
|
|
1209
|
+
},
|
|
1210
|
+
extraction_mode: {
|
|
1211
|
+
type: 'string',
|
|
1212
|
+
enum: ['full', 'delta'],
|
|
1213
|
+
description: 'Switch the DTP extraction mode. "full" sets extractionMode="F"; "delta" sets extractionMode="D" (only valid for delta-capable sources). Switching modes has delta-init implications — see the tool note.',
|
|
1214
|
+
},
|
|
1215
|
+
transport: {
|
|
1216
|
+
type: 'string',
|
|
1217
|
+
description: 'Transport request number. Required on systems with transport obligation.',
|
|
1218
|
+
},
|
|
1219
|
+
transport_lock_holder: {
|
|
1220
|
+
type: 'string',
|
|
1221
|
+
description: 'Transport lock holder. The transport request that currently owns the object lock. Required on some systems when updating an existing object.',
|
|
1222
|
+
},
|
|
1223
|
+
},
|
|
1224
|
+
required: ['dtp_name'],
|
|
1225
|
+
},
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
name: 'bw_get_push_schema',
|
|
1229
|
+
description: 'Fetch the JSON schema for an aDSO write interface. ' +
|
|
1230
|
+
'Returns field names, data types, and required fields. ' +
|
|
1231
|
+
'Use this before bw_push_data to know what fields to include in records.',
|
|
1232
|
+
inputSchema: {
|
|
1233
|
+
type: 'object',
|
|
1234
|
+
properties: {
|
|
1235
|
+
adso_name: {
|
|
1236
|
+
type: 'string',
|
|
1237
|
+
description: 'aDSO technical name (e.g. "ADSO_NAME").',
|
|
1238
|
+
},
|
|
1239
|
+
},
|
|
1240
|
+
required: ['adso_name'],
|
|
1241
|
+
},
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
name: 'bw_push_data',
|
|
1245
|
+
description: 'Push data records directly into an aDSO inbound table via the SAP BW/4HANA write interface. ' +
|
|
1246
|
+
'The aDSO must have write_interface enabled (pushMode="true"). ' +
|
|
1247
|
+
'Use bw_get_push_schema first to verify field names and types. ' +
|
|
1248
|
+
'Success = HTTP 204 (SAP returns empty body). ' +
|
|
1249
|
+
'DATS fields must be formatted as YYYYMMDD strings. INT4 fields as JSON integers.',
|
|
1250
|
+
inputSchema: {
|
|
1251
|
+
type: 'object',
|
|
1252
|
+
properties: {
|
|
1253
|
+
adso_name: {
|
|
1254
|
+
type: 'string',
|
|
1255
|
+
description: 'aDSO technical name (e.g. "ADSO_NAME").',
|
|
1256
|
+
},
|
|
1257
|
+
records: {
|
|
1258
|
+
type: 'array',
|
|
1259
|
+
description: 'Array of record objects. Field names must match aDSO field names exactly (uppercase).',
|
|
1260
|
+
items: { type: 'object' },
|
|
1261
|
+
},
|
|
1262
|
+
mode: {
|
|
1263
|
+
type: 'string',
|
|
1264
|
+
enum: ['one_step', 'messaging'],
|
|
1265
|
+
description: 'Push mode. "one_step" (default): implicit request per call. "messaging": uses ?request=MESSAGING param.',
|
|
1266
|
+
},
|
|
1267
|
+
},
|
|
1268
|
+
required: ['adso_name', 'records'],
|
|
1269
|
+
},
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
name: 'bw_get_query',
|
|
1273
|
+
description: 'Read a BW Query definition — variables, filter, layout (rows/columns/free characteristics), ' +
|
|
1274
|
+
'calculated and restricted measures, exceptions, and cell definitions. ' +
|
|
1275
|
+
'Tries the active version first; falls back to the inactive version if not found. ' +
|
|
1276
|
+
'format="text" (default): compact human-readable output. format="raw": full parsed JSON.',
|
|
1277
|
+
inputSchema: {
|
|
1278
|
+
type: 'object',
|
|
1279
|
+
properties: {
|
|
1280
|
+
query_name: {
|
|
1281
|
+
type: 'string',
|
|
1282
|
+
description: 'Technical name of the query (e.g. "QUERY_NAME").',
|
|
1283
|
+
},
|
|
1284
|
+
format: {
|
|
1285
|
+
type: 'string',
|
|
1286
|
+
enum: ['text', 'raw'],
|
|
1287
|
+
description: '"text" (default): structured human-readable output. "raw": full parsed JSON.',
|
|
1288
|
+
},
|
|
1289
|
+
},
|
|
1290
|
+
required: ['query_name'],
|
|
1291
|
+
},
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
name: 'bw_get_composite_provider',
|
|
1295
|
+
description: 'Read a CompositeProvider (HCPR) structure — general info, view node type (Union/Join), ' +
|
|
1296
|
+
'source providers (inputs) with mapping counts, fields with dimension classification, ' +
|
|
1297
|
+
'join condition, and temporal join details. Returns the inactive version.',
|
|
1298
|
+
inputSchema: {
|
|
1299
|
+
type: 'object',
|
|
1300
|
+
properties: {
|
|
1301
|
+
composite_provider_name: {
|
|
1302
|
+
type: 'string',
|
|
1303
|
+
description: 'Technical name of the CompositeProvider (e.g. "HCPR_NAME").',
|
|
1304
|
+
},
|
|
1305
|
+
},
|
|
1306
|
+
required: ['composite_provider_name'],
|
|
1307
|
+
},
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
name: 'bw_list_contents',
|
|
1311
|
+
description: 'Read the direct children of any node in the BW repository tree. ' +
|
|
1312
|
+
'The path parameter maps to the navigation hierarchy: ' +
|
|
1313
|
+
'use "/" or "" for all InfoAreas, ' +
|
|
1314
|
+
'"area/{name}" for InfoArea contents (object type folders), ' +
|
|
1315
|
+
'"area/{name}/{folder}" for objects within a folder (e.g. "area/MYAREA/adso"), ' +
|
|
1316
|
+
'"{type}/{name}" to expand an object (e.g. "hcpr/CP_NAME" → sub-folders), ' +
|
|
1317
|
+
'"{type}/{name}/{subfolder}" for objects within a sub-folder (e.g. "adso/ADSO_NAME/trfn"). ' +
|
|
1318
|
+
'Returns name, description, object_type, object_subtype, status, has_children, ' +
|
|
1319
|
+
'self_url, fiori_only, and children_path (pass directly to bw_list_contents to drill down).',
|
|
1320
|
+
inputSchema: {
|
|
1321
|
+
type: 'object',
|
|
1322
|
+
properties: {
|
|
1323
|
+
path: {
|
|
1324
|
+
type: 'string',
|
|
1325
|
+
description: 'Repository path to list. Use "/" or "" for all InfoAreas. ' +
|
|
1326
|
+
'Examples: "area/MYAREA", "area/MYAREA/hcpr", "hcpr/CP_NAME", "hcpr/CP_NAME/elem_ckf", "adso/ADSO_NAME/trfn".',
|
|
1327
|
+
},
|
|
1328
|
+
},
|
|
1329
|
+
required: ['path'],
|
|
1330
|
+
},
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
name: 'bw_list_source_systems',
|
|
1334
|
+
description: 'List logical source systems (LSYS) registered in the BW datasource structure. ' +
|
|
1335
|
+
'If source_system_type is provided, lists only source systems of that type (e.g. "ODP_SAP", "ODP_BW", "FILE"). ' +
|
|
1336
|
+
'If omitted, lists all source systems across all types. ' +
|
|
1337
|
+
'Returns each LSYS with name, description, source_system_type, status, self_url, and children_path ' +
|
|
1338
|
+
'(pass children_path directly to bw_list_datasources as the source_system argument).',
|
|
1339
|
+
inputSchema: {
|
|
1340
|
+
type: 'object',
|
|
1341
|
+
properties: {
|
|
1342
|
+
source_system_type: {
|
|
1343
|
+
type: 'string',
|
|
1344
|
+
description: 'Optional source system type filter. Known values: ODP_BW, ODP_SAP, ODP_CDS, ODP, FILE. ' +
|
|
1345
|
+
'Omit to list all source systems.',
|
|
1346
|
+
},
|
|
1347
|
+
},
|
|
1348
|
+
required: [],
|
|
1349
|
+
},
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
name: 'bw_list_datasources',
|
|
1353
|
+
description: 'List all DataSources (RSDS) available under a logical source system. ' +
|
|
1354
|
+
'Recursively traverses the full application component (APCO) hierarchy — may take time for large systems. ' +
|
|
1355
|
+
'Returns each DataSource with name, source_system, description, status, self_url, and apco_path ' +
|
|
1356
|
+
'(ordered list of application component titles from root to the DataSource). ' +
|
|
1357
|
+
'Optional apco_path_filter restricts the result to a hierarchy subtree and also prunes traversal.',
|
|
1358
|
+
inputSchema: {
|
|
1359
|
+
type: 'object',
|
|
1360
|
+
properties: {
|
|
1361
|
+
source_system: {
|
|
1362
|
+
type: 'string',
|
|
1363
|
+
description: 'Logical source system name (e.g. "LSYS_NAME"). Case-insensitive.',
|
|
1364
|
+
},
|
|
1365
|
+
format: {
|
|
1366
|
+
type: 'string',
|
|
1367
|
+
enum: ['text', 'raw'],
|
|
1368
|
+
description: 'Output format. "text" (default): compact plain-text table. "raw": raw XML feed bodies from BW.',
|
|
1369
|
+
},
|
|
1370
|
+
apco_path_filter: {
|
|
1371
|
+
type: 'string',
|
|
1372
|
+
description: 'Optional APCO hierarchy filter. A contiguous sequence of APCO names, "/"-style separated by ">". ' +
|
|
1373
|
+
'May start at any depth in the hierarchy (not root-anchored). Example: "LEVEL_1 > LEVEL_2" returns ' +
|
|
1374
|
+
'every DataSource that lives under a path containing LEVEL_1 directly followed by LEVEL_2. ' +
|
|
1375
|
+
'Each segment matches case-insensitively against the APCO display title OR the technical APCO name (trimmed). ' +
|
|
1376
|
+
'A single segment like "IS-U" returns all DataSources under any APCO subtree named "IS-U", at any depth.',
|
|
1377
|
+
},
|
|
1378
|
+
},
|
|
1379
|
+
required: ['source_system'],
|
|
1380
|
+
},
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
name: 'bw_get_source_system',
|
|
1384
|
+
description: 'Read the metadata of a single logical source system (LSYS) — type, description, connection details, and maintenance properties.',
|
|
1385
|
+
inputSchema: {
|
|
1386
|
+
type: 'object',
|
|
1387
|
+
properties: {
|
|
1388
|
+
source_system: {
|
|
1389
|
+
type: 'string',
|
|
1390
|
+
description: 'Logical source system name (e.g. "LSYS_NAME"). Case-insensitive.',
|
|
1391
|
+
},
|
|
1392
|
+
},
|
|
1393
|
+
required: ['source_system'],
|
|
1394
|
+
},
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
name: 'bw_get_datasource',
|
|
1398
|
+
description: 'Read the full structure of a DataSource (RSDS) — metadata, all fields with types and properties, and adapter configuration.',
|
|
1399
|
+
inputSchema: {
|
|
1400
|
+
type: 'object',
|
|
1401
|
+
properties: {
|
|
1402
|
+
datasource_name: {
|
|
1403
|
+
type: 'string',
|
|
1404
|
+
description: 'Technical name of the DataSource (e.g. "DS_NAME").',
|
|
1405
|
+
},
|
|
1406
|
+
source_system: {
|
|
1407
|
+
type: 'string',
|
|
1408
|
+
description: 'Logical source system name (e.g. "LSYS_NAME").',
|
|
1409
|
+
},
|
|
1410
|
+
format: {
|
|
1411
|
+
type: 'string',
|
|
1412
|
+
enum: ['text', 'raw'],
|
|
1413
|
+
description: 'Output format. "text" (default): compact human-readable summary. "raw": raw XML from BW.',
|
|
1414
|
+
},
|
|
1415
|
+
},
|
|
1416
|
+
required: ['datasource_name', 'source_system'],
|
|
1417
|
+
},
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
name: 'bw_preview_datasource',
|
|
1421
|
+
description: 'Fetch a live data preview / sample rows from a DataSource (RSDS) — ' +
|
|
1422
|
+
'reads the first N rows directly from the source system and returns them ' +
|
|
1423
|
+
'as a formatted table with field names as column headers. ' +
|
|
1424
|
+
'Use this when the user wants to see, sample, preview, or inspect the actual ' +
|
|
1425
|
+
'data behind a DataSource (e.g. "show me data from DS_X", "preview 50 rows", ' +
|
|
1426
|
+
'"what does DS_X look like"). ' +
|
|
1427
|
+
'For data from an aDSO, CompositeProvider, or BEx query, use bw_query_data instead.',
|
|
1428
|
+
inputSchema: {
|
|
1429
|
+
type: 'object',
|
|
1430
|
+
properties: {
|
|
1431
|
+
datasource_name: {
|
|
1432
|
+
type: 'string',
|
|
1433
|
+
description: 'DataSource name (e.g. "DS_NAME"). Case-insensitive.',
|
|
1434
|
+
},
|
|
1435
|
+
source_system: {
|
|
1436
|
+
type: 'string',
|
|
1437
|
+
description: 'Logical source system name (e.g. "LSYS_NAME"). Case-insensitive.',
|
|
1438
|
+
},
|
|
1439
|
+
records: {
|
|
1440
|
+
type: 'number',
|
|
1441
|
+
description: 'Number of records to fetch (default: 20). SAP returns at most this many rows.',
|
|
1442
|
+
},
|
|
1443
|
+
},
|
|
1444
|
+
required: ['datasource_name', 'source_system'],
|
|
1445
|
+
},
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
name: 'bw_get_ckf',
|
|
1449
|
+
description: 'Read a global Calculated Key Figure (CKF) defined at CompositeProvider level. ' +
|
|
1450
|
+
'Returns technical name, description, formula (recursively resolved), metadata, ' +
|
|
1451
|
+
'and the full dependency graph of referenced CKF/RKF sub-components.',
|
|
1452
|
+
inputSchema: {
|
|
1453
|
+
type: 'object',
|
|
1454
|
+
properties: {
|
|
1455
|
+
component_name: {
|
|
1456
|
+
type: 'string',
|
|
1457
|
+
description: 'Technical name of the CKF (e.g. "CKF_NAME").',
|
|
1458
|
+
},
|
|
1459
|
+
},
|
|
1460
|
+
required: ['component_name'],
|
|
1461
|
+
},
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
name: 'bw_get_rkf',
|
|
1465
|
+
description: 'Read a global Restricted Key Figure (RKF) defined at CompositeProvider level. ' +
|
|
1466
|
+
'Returns technical name, description, base measure, characteristic filters, metadata, ' +
|
|
1467
|
+
'and the full dependency graph of referenced CKF/RKF sub-components.',
|
|
1468
|
+
inputSchema: {
|
|
1469
|
+
type: 'object',
|
|
1470
|
+
properties: {
|
|
1471
|
+
component_name: {
|
|
1472
|
+
type: 'string',
|
|
1473
|
+
description: 'Technical name of the RKF (e.g. "RKF_NAME").',
|
|
1474
|
+
},
|
|
1475
|
+
},
|
|
1476
|
+
required: ['component_name'],
|
|
1477
|
+
},
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
name: 'bw_get_structure',
|
|
1481
|
+
description: 'Read a global Structure defined at CompositeProvider level. ' +
|
|
1482
|
+
'Returns the ordered member list with type (Selection/Formula), referenced component ' +
|
|
1483
|
+
'or IOBJ name, characteristic filters, and the full dependency graph.',
|
|
1484
|
+
inputSchema: {
|
|
1485
|
+
type: 'object',
|
|
1486
|
+
properties: {
|
|
1487
|
+
component_name: {
|
|
1488
|
+
type: 'string',
|
|
1489
|
+
description: 'Technical name of the Structure (e.g. "STR_NAME").',
|
|
1490
|
+
},
|
|
1491
|
+
},
|
|
1492
|
+
required: ['component_name'],
|
|
1493
|
+
},
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
name: 'bw_query_data',
|
|
1497
|
+
description: 'Execute a BW query or preview data from a provider (CompositeProvider, aDSO, etc.) via the BICS reporting endpoint. ' +
|
|
1498
|
+
'ALWAYS call the appropriate read tool first before querying data: ' +
|
|
1499
|
+
'bw_get_composite_provider for a CompositeProvider (is_provider=true), ' +
|
|
1500
|
+
'bw_get_adso for an aDSO (is_provider=true), ' +
|
|
1501
|
+
'bw_get_query for a BEx Query — this gives you the available fields, key figures, ' +
|
|
1502
|
+
'and the query structure before you attempt a data call. ' +
|
|
1503
|
+
'Then perform a GET (no state/variables) first to discover the current axis layout, ' +
|
|
1504
|
+
'characteristic ids, variables, and background filters before sending any POST. ' +
|
|
1505
|
+
'IMPORTANT — always call bw_get_filter_values before applying any filter or variable value. ' +
|
|
1506
|
+
'This is the only way to know the correct internal key format for a characteristic ' +
|
|
1507
|
+
'(e.g. date/time characteristics like 0CALMONTH, 0CALYEAR, 0CALDAY may use non-obvious formats). ' +
|
|
1508
|
+
'Never guess or assume filter value formats — always look them up first. ' +
|
|
1509
|
+
'If the GET response shows inputRequired="true", variables must be filled via POST before data is available. ' +
|
|
1510
|
+
'If unsure whether a BEx Query exists for the desired analysis, use bw_search or bw_list_contents first ' +
|
|
1511
|
+
'before falling back to a direct provider call (is_provider=true). ' +
|
|
1512
|
+
'Result is rendered as a formatted table with hierarchy indentation. ' +
|
|
1513
|
+
'KEY FIGURE STRUCTURE FILTER: to restrict which key figures appear in the result, apply filterValues ' +
|
|
1514
|
+
'directly on the structure dimension (isStructure=true) in state.infoObjects — use the technical name ' +
|
|
1515
|
+
'of the calculated or restricted key figure as the low value (e.g. "CKF_NAME" or "RKF_NAME"). ' +
|
|
1516
|
+
'Hierarchical children of the filtered member are included automatically. ' +
|
|
1517
|
+
'This is the correct approach because ad-hoc threshold filters on key figure values are not supported ' +
|
|
1518
|
+
'via the state mechanism; only structure-member selection is possible this way. ' +
|
|
1519
|
+
'CRITICAL: variable id and name values in the variablesContainer are session-specific ' +
|
|
1520
|
+
'and change between GET calls. Always extract variable id and name exactly from the ' +
|
|
1521
|
+
'variablesContainer in the GET response and use them immediately in the next POST — ' +
|
|
1522
|
+
'never reuse IDs from a previous GET call or from bw_get_query output. ' +
|
|
1523
|
+
'The variable name includes trailing spaces and a 4-digit suffix (e.g. "VARNAME 0004") ' +
|
|
1524
|
+
'that must be copied verbatim from the GET response. ' +
|
|
1525
|
+
'format="raw" returns XML.',
|
|
1526
|
+
inputSchema: {
|
|
1527
|
+
type: 'object',
|
|
1528
|
+
properties: {
|
|
1529
|
+
comp_id: {
|
|
1530
|
+
type: 'string',
|
|
1531
|
+
description: 'BEx Query name or InfoProvider name (ADSO, HCPR, etc.) to query.',
|
|
1532
|
+
},
|
|
1533
|
+
is_provider: {
|
|
1534
|
+
type: 'boolean',
|
|
1535
|
+
description: 'Set to true when comp_id is an InfoProvider name (CompositeProvider, aDSO, etc.) ' +
|
|
1536
|
+
'rather than a BEx Query name. Adds the required "!" prefix to the compid URL parameter. ' +
|
|
1537
|
+
'If unsure whether a query exists for the desired analysis, use bw_search or ' +
|
|
1538
|
+
'bw_list_contents first to check before falling back to a direct provider call.',
|
|
1539
|
+
},
|
|
1540
|
+
format: {
|
|
1541
|
+
type: 'string',
|
|
1542
|
+
enum: ['text', 'raw'],
|
|
1543
|
+
description: '"text" (default): structured human-readable output. "raw": raw XML response body.',
|
|
1544
|
+
},
|
|
1545
|
+
state: {
|
|
1546
|
+
type: 'object',
|
|
1547
|
+
description: 'Axis layout and optional per-characteristic filters. ' +
|
|
1548
|
+
'All InfoObjects from the query must be listed (even those staying on FREE axis). ' +
|
|
1549
|
+
'id values must come from the GET metadata response.',
|
|
1550
|
+
properties: {
|
|
1551
|
+
infoObjects: {
|
|
1552
|
+
type: 'array',
|
|
1553
|
+
items: {
|
|
1554
|
+
type: 'object',
|
|
1555
|
+
properties: {
|
|
1556
|
+
name: { type: 'string', description: 'InfoObject technical name.' },
|
|
1557
|
+
id: { type: 'string', description: 'id from the GET metadata response.' },
|
|
1558
|
+
axis: { type: 'string', enum: ['ROWS', 'COLUMNS', 'FREE'], description: 'Target axis.' },
|
|
1559
|
+
hierarchy: {
|
|
1560
|
+
type: 'object',
|
|
1561
|
+
description: 'Active hierarchy for this characteristic. Required when filtering by hierarchy node (nodeId=1). ' +
|
|
1562
|
+
'Copy id, name, hryId, hryDateFrom, hryDateTo from the <hierarchy> element in the GET response.',
|
|
1563
|
+
properties: {
|
|
1564
|
+
id: { type: 'string', description: 'Hierarchy id attribute from GET response.' },
|
|
1565
|
+
name: { type: 'string', description: 'Hierarchy name (technical name).' },
|
|
1566
|
+
hryId: { type: 'string', description: 'hryId attribute (display name / variant).' },
|
|
1567
|
+
hryDateFrom: { type: 'string', description: 'Validity from date (YYYYMMDD). Defaults to 00000000.' },
|
|
1568
|
+
hryDateTo: { type: 'string', description: 'Validity to date (YYYYMMDD). Defaults to 99991231.' },
|
|
1569
|
+
},
|
|
1570
|
+
required: ['id', 'name', 'hryId'],
|
|
1571
|
+
},
|
|
1572
|
+
filterValues: {
|
|
1573
|
+
type: 'array',
|
|
1574
|
+
description: 'Optional filter selections for this characteristic. ' +
|
|
1575
|
+
'Also works on structure dimensions (isStructure=true on ROWS or COLUMNS): ' +
|
|
1576
|
+
'set low to the technical name of a key figure, calculated key figure, or restricted key figure ' +
|
|
1577
|
+
'(e.g. "CKF_NAME") to restrict the result to that structure member and its children. ' +
|
|
1578
|
+
'This is the only supported way to filter by key figure in BICS.',
|
|
1579
|
+
items: {
|
|
1580
|
+
type: 'object',
|
|
1581
|
+
properties: {
|
|
1582
|
+
low: { type: 'string', description: 'Filter value in external key format (e.g. altName or CHAVL_EXT). Use this for members that have a named external key.' },
|
|
1583
|
+
lowInt: { type: 'string', description: 'Filter value in internal key format (e.g. GUID like 00O2...). Use when the member has no altName and only an internal GUID is known. Sends presentationMode="INT" in BICS XML.' },
|
|
1584
|
+
lowText: { type: 'string', description: 'Display text for the value (optional).' },
|
|
1585
|
+
high: { type: 'string', description: 'Upper bound for interval operator BT.' },
|
|
1586
|
+
op: { type: 'string', description: 'Operator: EQ (default), BT, GT, LT, GE, LE.' },
|
|
1587
|
+
sign: { type: 'string', description: 'I=include (default), E=exclude.' },
|
|
1588
|
+
nodeId: { type: 'number', description: 'Node selection mode: 0=leaf member (default), 1=hierarchy node (use when filtering a collapsed hierarchy node like a group).' },
|
|
1589
|
+
},
|
|
1590
|
+
},
|
|
1591
|
+
},
|
|
1592
|
+
},
|
|
1593
|
+
required: ['name', 'id', 'axis'],
|
|
1594
|
+
},
|
|
1595
|
+
},
|
|
1596
|
+
},
|
|
1597
|
+
required: ['infoObjects'],
|
|
1598
|
+
},
|
|
1599
|
+
variables: {
|
|
1600
|
+
type: 'array',
|
|
1601
|
+
description: 'Variable values to fill. name must match exactly as returned by GET (may contain trailing spaces). ' +
|
|
1602
|
+
'id and other metadata fields come from the GET variablesContainer response.',
|
|
1603
|
+
items: {
|
|
1604
|
+
type: 'object',
|
|
1605
|
+
properties: {
|
|
1606
|
+
name: { type: 'string', description: 'Variable technical name (exact, including trailing spaces).' },
|
|
1607
|
+
id: { type: 'string', description: 'Variable id from the GET response.' },
|
|
1608
|
+
txt: { type: 'string', description: 'Variable label (optional, for readability).' },
|
|
1609
|
+
altName: { type: 'string', description: 'altName from the GET response (optional).' },
|
|
1610
|
+
type: { type: 'string', description: 'Variable type (default "charMember").' },
|
|
1611
|
+
inputEnabled: { type: 'boolean', description: 'Whether the variable accepts input (default true).' },
|
|
1612
|
+
mandatory: { type: 'boolean', description: 'Whether the variable is mandatory.' },
|
|
1613
|
+
iobj: { type: 'string', description: 'InfoObject the variable is based on.' },
|
|
1614
|
+
values: {
|
|
1615
|
+
type: 'array',
|
|
1616
|
+
description: 'List of select values to assign.',
|
|
1617
|
+
items: {
|
|
1618
|
+
type: 'object',
|
|
1619
|
+
properties: {
|
|
1620
|
+
low: { type: 'string', description: 'Value (CHAVL_INT internal key format).' },
|
|
1621
|
+
high: { type: 'string', description: 'Upper bound for interval (op=BT).' },
|
|
1622
|
+
op: { type: 'string', description: 'Operator: EQ (default) or BT.' },
|
|
1623
|
+
sign: { type: 'string', description: 'I=include (default).' },
|
|
1624
|
+
},
|
|
1625
|
+
required: ['low'],
|
|
1626
|
+
},
|
|
1627
|
+
},
|
|
1628
|
+
},
|
|
1629
|
+
required: ['name', 'id', 'values'],
|
|
1630
|
+
},
|
|
1631
|
+
},
|
|
1632
|
+
from_row: {
|
|
1633
|
+
type: 'number',
|
|
1634
|
+
description: 'Start row for pagination (default 0).',
|
|
1635
|
+
},
|
|
1636
|
+
to_row: {
|
|
1637
|
+
type: 'number',
|
|
1638
|
+
description: 'End row for pagination (default 1000).',
|
|
1639
|
+
},
|
|
1640
|
+
drill_operations: {
|
|
1641
|
+
type: 'array',
|
|
1642
|
+
description: 'Optional. Expand or collapse hierarchy nodes or key figure structure nodes in the current result. ' +
|
|
1643
|
+
'Each operation targets one node by its 1-based tuple index. ' +
|
|
1644
|
+
'drill_state: 3 = expand, 2 = collapse. ' +
|
|
1645
|
+
'element_idx: which dimension within the tuple (1 = first, 2 = second, etc.) — ' +
|
|
1646
|
+
'use 2 when ROWS has multiple dimensions and the target node is on the second one. ' +
|
|
1647
|
+
'Requires the full state and variables to be sent again in the same POST (stateless endpoint). ' +
|
|
1648
|
+
'Use after an initial bw_query_data call to drill into a collapsed structure node or hierarchy node.',
|
|
1649
|
+
items: {
|
|
1650
|
+
type: 'object',
|
|
1651
|
+
properties: {
|
|
1652
|
+
axis: { type: 'string', enum: ['ROWS', 'COLUMNS'] },
|
|
1653
|
+
drill_state: { type: 'number', description: '3 = expand, 2 = collapse.' },
|
|
1654
|
+
tuple_idx: { type: 'number', description: '1-based index of the tuple in the current result.' },
|
|
1655
|
+
element_idx: { type: 'number', description: '1-based index of the dimension within the tuple.' },
|
|
1656
|
+
},
|
|
1657
|
+
required: ['axis', 'drill_state', 'tuple_idx', 'element_idx'],
|
|
1658
|
+
},
|
|
1659
|
+
},
|
|
1660
|
+
},
|
|
1661
|
+
required: ['comp_id'],
|
|
1662
|
+
},
|
|
1663
|
+
},
|
|
1664
|
+
{
|
|
1665
|
+
name: 'bw_get_filter_values',
|
|
1666
|
+
description: 'Look up valid characteristic values for use in query filters or variable inputs. ' +
|
|
1667
|
+
'Returns CHAVL_INT (internal key) — always use this value when setting filter selectValues or variable inputs; ' +
|
|
1668
|
+
'CHAVL_EXT and CHAVL_INT often differ for date-type characteristics. ' +
|
|
1669
|
+
'Supports wildcard search: use "*" to return all values, "2022*" for prefix match. ' +
|
|
1670
|
+
'Optionally scope results to a specific InfoProvider (recommended when values differ by provider).',
|
|
1671
|
+
inputSchema: {
|
|
1672
|
+
type: 'object',
|
|
1673
|
+
properties: {
|
|
1674
|
+
characteristic_name: {
|
|
1675
|
+
type: 'string',
|
|
1676
|
+
description: 'InfoObject technical name to get values for (e.g. "IOBJ_NAME").',
|
|
1677
|
+
},
|
|
1678
|
+
search_string: {
|
|
1679
|
+
type: 'string',
|
|
1680
|
+
description: 'Wildcard search pattern. "*" returns all values up to max_rows. Prefix with text to filter (e.g. "2022*").',
|
|
1681
|
+
},
|
|
1682
|
+
info_provider: {
|
|
1683
|
+
type: 'string',
|
|
1684
|
+
description: 'Optional. Scopes the value list to a specific InfoProvider (ADSO, HCPR, etc.). Omit to read from master data directly.',
|
|
1685
|
+
},
|
|
1686
|
+
max_rows: {
|
|
1687
|
+
type: 'number',
|
|
1688
|
+
description: 'Maximum number of values to return (default 201).',
|
|
1689
|
+
},
|
|
1690
|
+
},
|
|
1691
|
+
required: ['characteristic_name', 'search_string'],
|
|
1692
|
+
},
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
name: 'bw_get_roles',
|
|
1696
|
+
description: 'Load the complete BW query role hierarchy as shown in the "Publish to Role" dialog. ' +
|
|
1697
|
+
'Returns all roles (ROLE nodes) and their folder structure (FOLDER nodes) with nodeids. ' +
|
|
1698
|
+
'Use this to discover role names and folder names needed for bw_set_query_roles. ' +
|
|
1699
|
+
'Optionally filter to roles whose name starts with a given prefix.',
|
|
1700
|
+
inputSchema: {
|
|
1701
|
+
type: 'object',
|
|
1702
|
+
properties: {
|
|
1703
|
+
role_filter: {
|
|
1704
|
+
type: 'string',
|
|
1705
|
+
description: 'Optional prefix to filter results. Only ROLE nodes whose name starts with this prefix are included (e.g. "BW:").',
|
|
1706
|
+
},
|
|
1707
|
+
},
|
|
1708
|
+
required: [],
|
|
1709
|
+
},
|
|
1710
|
+
},
|
|
1711
|
+
{
|
|
1712
|
+
name: 'bw_get_query_roles',
|
|
1713
|
+
description: 'Get all roles and folders where a specific BW query is currently published. ' +
|
|
1714
|
+
'Returns the role name, description, and folder for each assignment. ' +
|
|
1715
|
+
'If the query is not published anywhere, returns a clear message.',
|
|
1716
|
+
inputSchema: {
|
|
1717
|
+
type: 'object',
|
|
1718
|
+
properties: {
|
|
1719
|
+
query_name: {
|
|
1720
|
+
type: 'string',
|
|
1721
|
+
description: 'Technical name of the BW query (case-insensitive).',
|
|
1722
|
+
},
|
|
1723
|
+
},
|
|
1724
|
+
required: ['query_name'],
|
|
1725
|
+
},
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
name: 'bw_set_query_roles',
|
|
1729
|
+
description: 'Publish or unpublish a BW query in a role or folder. ' +
|
|
1730
|
+
'action "add": assigns the query to the given role or folder. ' +
|
|
1731
|
+
'action "remove": removes the query from the given role or folder. ' +
|
|
1732
|
+
'Use bw_get_roles to discover role/folder names and bw_get_query_roles to see current assignments.',
|
|
1733
|
+
inputSchema: {
|
|
1734
|
+
type: 'object',
|
|
1735
|
+
properties: {
|
|
1736
|
+
query_name: {
|
|
1737
|
+
type: 'string',
|
|
1738
|
+
description: 'Technical name of the BW query (case-insensitive).',
|
|
1739
|
+
},
|
|
1740
|
+
action: {
|
|
1741
|
+
type: 'string',
|
|
1742
|
+
enum: ['add', 'remove'],
|
|
1743
|
+
description: '"add" to publish, "remove" to unpublish.',
|
|
1744
|
+
},
|
|
1745
|
+
target_name: {
|
|
1746
|
+
type: 'string',
|
|
1747
|
+
description: 'For target_type "role": the name attribute of the ROLE node (e.g. from bw_get_roles). ' +
|
|
1748
|
+
'For target_type "folder": the txt (display name) of the FOLDER node.',
|
|
1749
|
+
},
|
|
1750
|
+
target_type: {
|
|
1751
|
+
type: 'string',
|
|
1752
|
+
enum: ['role', 'folder'],
|
|
1753
|
+
description: '"role" to assign at role level, "folder" to assign into a specific subfolder.',
|
|
1754
|
+
},
|
|
1755
|
+
parent_role_name: {
|
|
1756
|
+
type: 'string',
|
|
1757
|
+
description: 'Required when target_type is "folder". The name attribute of the parent ROLE node that contains the target folder.',
|
|
1758
|
+
},
|
|
1759
|
+
},
|
|
1760
|
+
required: ['query_name', 'action', 'target_name', 'target_type'],
|
|
1761
|
+
},
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
name: 'bw_get_role_queries',
|
|
1765
|
+
description: 'List all BW queries published in BW roles (via the "Publish to Role" mechanism). ' +
|
|
1766
|
+
'Returns each role with its assigned queries, including technical name, description, object type, and InfoProvider. ' +
|
|
1767
|
+
'Note: only SAP_BW_QUERY objects are returned; PFCG menu entries of other types (e.g. AFO workbooks added as transactions) are not included. ' +
|
|
1768
|
+
'Use role_name to filter to a specific role; omit it to see all roles with published queries.',
|
|
1769
|
+
inputSchema: {
|
|
1770
|
+
type: 'object',
|
|
1771
|
+
properties: {
|
|
1772
|
+
role_name: {
|
|
1773
|
+
type: 'string',
|
|
1774
|
+
description: 'Optional. Technical name of the role to filter by (e.g. from bw_get_roles). Omit to return all roles.',
|
|
1775
|
+
},
|
|
1776
|
+
},
|
|
1777
|
+
required: [],
|
|
1778
|
+
},
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
name: 'bw_get_dataflow',
|
|
1782
|
+
description: 'Trace the data flow graph for a BW object. ' +
|
|
1783
|
+
'Returns a tree (≤ 30 nodes) or flat table (> 30 nodes) showing all connected objects ' +
|
|
1784
|
+
'(ADSO, RSDS, TRFN, DTPA, TRCS, IOBJ, HCPR, LSYS, ELEM) with their type, name, description, and status. ' +
|
|
1785
|
+
'BW direction convention: "upwards" traverses towards BW target objects (ADSO, TRFN, TRCS, IOBJ); ' +
|
|
1786
|
+
'"downwards" traverses towards source systems (LSYS, RSDS). ' +
|
|
1787
|
+
'Use this to understand the full lineage of an object without navigating each connection manually. ' +
|
|
1788
|
+
'IMPORTANT: Always print the complete tool result verbatim as a fenced code block in your chat response — never omit or summarize it.',
|
|
1789
|
+
inputSchema: {
|
|
1790
|
+
type: 'object',
|
|
1791
|
+
properties: {
|
|
1792
|
+
object_name: {
|
|
1793
|
+
type: 'string',
|
|
1794
|
+
description: 'Technical name of the BW object (e.g. "ADSO_NAME", "DS_NAME").',
|
|
1795
|
+
},
|
|
1796
|
+
object_type: {
|
|
1797
|
+
type: 'string',
|
|
1798
|
+
description: 'BW object type: ADSO, RSDS, HCPR, TRFN, DTPA, IOBJ, TRCS, LSYS.',
|
|
1799
|
+
},
|
|
1800
|
+
source_system: {
|
|
1801
|
+
type: 'string',
|
|
1802
|
+
description: 'Required when object_type is RSDS. Logical source system name (e.g. "LSYS_NAME").',
|
|
1803
|
+
},
|
|
1804
|
+
direction: {
|
|
1805
|
+
type: 'string',
|
|
1806
|
+
enum: ['upwards', 'downwards', 'both'],
|
|
1807
|
+
description: 'Direction to traverse: "upwards" (towards BW target objects: ADSO, TRFN, TRCS, IOBJ), "downwards" (towards source systems: LSYS, RSDS), or "both". Default "both".',
|
|
1808
|
+
},
|
|
1809
|
+
levels: {
|
|
1810
|
+
type: 'number',
|
|
1811
|
+
description: 'Number of levels to expand in each direction. -1 = all levels (default).',
|
|
1812
|
+
},
|
|
1813
|
+
format: {
|
|
1814
|
+
type: 'string',
|
|
1815
|
+
enum: ['text', 'raw'],
|
|
1816
|
+
description: 'Output format. "text" (default): tree or flat table. "raw": raw XML from BW.',
|
|
1817
|
+
},
|
|
1818
|
+
},
|
|
1819
|
+
required: ['object_name', 'object_type'],
|
|
1820
|
+
},
|
|
1821
|
+
},
|
|
1822
|
+
],
|
|
1823
|
+
}));
|
|
1824
|
+
// ── Tool handlers ─────────────────────────────────────────────────────────────
|
|
1825
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
1826
|
+
const { name, arguments: args } = request.params;
|
|
1827
|
+
try {
|
|
1828
|
+
let text;
|
|
1829
|
+
switch (name) {
|
|
1830
|
+
case 'bw_search':
|
|
1831
|
+
text = await bwSearch(client, args?.search_term, args?.object_type);
|
|
1832
|
+
break;
|
|
1833
|
+
case 'bw_xref':
|
|
1834
|
+
text = await bwXref(client, args?.object_type, args?.object_name, args?.source_system);
|
|
1835
|
+
break;
|
|
1836
|
+
case 'bw_get_adso':
|
|
1837
|
+
text = await bwGetAdso(client, args?.adso_name, args?.format ?? 'text');
|
|
1838
|
+
break;
|
|
1839
|
+
case 'bw_create_adso':
|
|
1840
|
+
text = await bwCreateAdso(client, args?.adso_name, args?.label, args?.info_area, args?.action ?? 'from_template', args?.template_name, args?.template_type ?? 'ADSO', args?.source_system, args?.adso_type ?? 'standard', args?.package ?? '$TMP', args?.write_interface ?? false);
|
|
1841
|
+
break;
|
|
1842
|
+
case 'bw_update_adso':
|
|
1843
|
+
if (args?.action === 'update_settings') {
|
|
1844
|
+
const s = (args?.settings ?? {});
|
|
1845
|
+
const settings = {
|
|
1846
|
+
adsoType: s['adso_type'],
|
|
1847
|
+
writeChangelog: s['write_changelog'],
|
|
1848
|
+
snapShotScenario: s['snap_shot_scenario'],
|
|
1849
|
+
uniqueDataRecords: s['unique_data_records'],
|
|
1850
|
+
planningMode: s['planning_mode'],
|
|
1851
|
+
writeInterface: s['write_interface'],
|
|
1852
|
+
label: s['label'],
|
|
1853
|
+
};
|
|
1854
|
+
// Remove undefined keys so applied output is clean
|
|
1855
|
+
Object.keys(settings).forEach((k) => settings[k] === undefined && delete settings[k]);
|
|
1856
|
+
settings.transport = args?.transport;
|
|
1857
|
+
text = await bwUpdateAdsoSettings(client, args?.adso_name, settings);
|
|
1858
|
+
}
|
|
1859
|
+
else if (args?.action === 'manage_keys') {
|
|
1860
|
+
text = await bwUpdateAdsoManageKeys(client, args?.adso_name, args?.key_fields ?? [], args?.transport);
|
|
1861
|
+
}
|
|
1862
|
+
else if (args?.action === 'add_pure_field') {
|
|
1863
|
+
const rawFields = args?.fields ?? [];
|
|
1864
|
+
const fieldDefs = rawFields.map((f) => ({
|
|
1865
|
+
name: f['name'],
|
|
1866
|
+
label: f['label'],
|
|
1867
|
+
dataType: f['data_type'],
|
|
1868
|
+
length: f['length'],
|
|
1869
|
+
precision: f['precision'],
|
|
1870
|
+
scale: f['scale'],
|
|
1871
|
+
aggregationBehavior: f['aggregation_behavior'],
|
|
1872
|
+
isKey: f['is_key'],
|
|
1873
|
+
}));
|
|
1874
|
+
text = await bwUpdateAdsoAddPureField(client, args?.adso_name, fieldDefs, args?.transport);
|
|
1875
|
+
}
|
|
1876
|
+
else if (args?.action === 'update_field_properties') {
|
|
1877
|
+
const p = (args?.properties ?? {});
|
|
1878
|
+
const fp = {};
|
|
1879
|
+
if (p['sid_determination_mode'] !== undefined)
|
|
1880
|
+
fp.sidDeterminationMode = p['sid_determination_mode'];
|
|
1881
|
+
if ('local_description' in p)
|
|
1882
|
+
fp.localDescription = p['local_description'];
|
|
1883
|
+
if (p['aggregation_behavior'] !== undefined)
|
|
1884
|
+
fp.aggregationBehavior = p['aggregation_behavior'];
|
|
1885
|
+
if ('fixed_currency' in p)
|
|
1886
|
+
fp.fixedCurrency = p['fixed_currency'];
|
|
1887
|
+
if ('fixed_unit' in p)
|
|
1888
|
+
fp.fixedUnit = p['fixed_unit'];
|
|
1889
|
+
if (p['description'] !== undefined)
|
|
1890
|
+
fp.description = p['description'];
|
|
1891
|
+
fp.transport = args?.transport;
|
|
1892
|
+
text = await bwUpdateAdsoFieldProperties(client, args?.adso_name, args?.field_name, fp);
|
|
1893
|
+
}
|
|
1894
|
+
else {
|
|
1895
|
+
text = await bwUpdateAdso(client, args?.adso_name, args?.infoobject_name, args?.action ?? 'add_field', args?.transport);
|
|
1896
|
+
}
|
|
1897
|
+
break;
|
|
1898
|
+
case 'bw_create_infoobject':
|
|
1899
|
+
text = await bwCreateInfoObject(client, {
|
|
1900
|
+
infoobject_type: args?.infoobject_type,
|
|
1901
|
+
name: args?.name,
|
|
1902
|
+
info_area: args?.info_area,
|
|
1903
|
+
description: args?.description,
|
|
1904
|
+
data_type: args?.data_type,
|
|
1905
|
+
length: args?.length,
|
|
1906
|
+
conversion_routine: args?.conversion_routine,
|
|
1907
|
+
with_master_data: args?.with_master_data,
|
|
1908
|
+
with_texts: args?.with_texts,
|
|
1909
|
+
referenced_infoobject: args?.referenced_infoobject,
|
|
1910
|
+
compound_infoobjects: args?.compound_infoobjects,
|
|
1911
|
+
object_specific_data_type: args?.object_specific_data_type,
|
|
1912
|
+
aggregation_type: args?.aggregation_type,
|
|
1913
|
+
fixed_unit: args?.fixed_unit,
|
|
1914
|
+
fixed_currency: args?.fixed_currency,
|
|
1915
|
+
package: args?.package,
|
|
1916
|
+
transport: args?.transport,
|
|
1917
|
+
});
|
|
1918
|
+
break;
|
|
1919
|
+
case 'bw_create_infoarea':
|
|
1920
|
+
text = await bwCreateInfoArea(client, {
|
|
1921
|
+
name: args?.name,
|
|
1922
|
+
parent_info_area: args?.parent_info_area,
|
|
1923
|
+
description: args?.description,
|
|
1924
|
+
package: args?.package,
|
|
1925
|
+
});
|
|
1926
|
+
break;
|
|
1927
|
+
case 'bw_create_transformation':
|
|
1928
|
+
text = await bwCreateTransformation(client, {
|
|
1929
|
+
source_object_type: args?.source_object_type,
|
|
1930
|
+
source_object_name: args?.source_object_name,
|
|
1931
|
+
target_object_type: args?.target_object_type,
|
|
1932
|
+
target_object_name: args?.target_object_name,
|
|
1933
|
+
package: args?.package,
|
|
1934
|
+
source_system: args?.source_system,
|
|
1935
|
+
copy_from_transformation: args?.copy_from_transformation,
|
|
1936
|
+
});
|
|
1937
|
+
break;
|
|
1938
|
+
case 'bw_move_object':
|
|
1939
|
+
text = await bwMoveObject(client, {
|
|
1940
|
+
objectType: args?.object_type,
|
|
1941
|
+
objectName: args?.object_name,
|
|
1942
|
+
targetInfoArea: args?.target_info_area,
|
|
1943
|
+
});
|
|
1944
|
+
break;
|
|
1945
|
+
case 'bw_get_infoobject':
|
|
1946
|
+
text = await bwGetInfoObject(client, args?.infoobject_name);
|
|
1947
|
+
break;
|
|
1948
|
+
case 'bw_update_infoobject': {
|
|
1949
|
+
const rawAttrs = args?.attributes ?? [];
|
|
1950
|
+
const attrDefs = rawAttrs.map((a) => ({
|
|
1951
|
+
name: a['name'],
|
|
1952
|
+
type: a['type'],
|
|
1953
|
+
timeDependent: a['time_dependent'],
|
|
1954
|
+
displayInQuery: a['display_in_query'],
|
|
1955
|
+
useTextOfOriginalCharacteristic: a['use_text_of_original_characteristic'],
|
|
1956
|
+
}));
|
|
1957
|
+
text = await bwUpdateInfoObject(client, {
|
|
1958
|
+
name: args?.name,
|
|
1959
|
+
attributes: attrDefs,
|
|
1960
|
+
description: args?.description,
|
|
1961
|
+
fixed_unit: args?.fixed_unit,
|
|
1962
|
+
fixed_currency: args?.fixed_currency,
|
|
1963
|
+
transport: args?.transport,
|
|
1964
|
+
});
|
|
1965
|
+
break;
|
|
1966
|
+
}
|
|
1967
|
+
case 'bw_get_transformation':
|
|
1968
|
+
text = await bwGetTransformation(client, args?.transformation_name, args?.format ?? 'text');
|
|
1969
|
+
break;
|
|
1970
|
+
case 'bw_update_transformation':
|
|
1971
|
+
text = await bwUpdateTransformation(client, args?.transformation_name, args?.source_field, args?.target_infoobject, args?.rule_type ?? 'direct', args?.formula, args?.constant_value, args?.lookup_object, args?.lookup_object_type, args?.transport, args?.additional_source_fields);
|
|
1972
|
+
break;
|
|
1973
|
+
case 'bw_delete_transformation_routine':
|
|
1974
|
+
text = await bwDeleteTransformationRoutine(client, args?.transformation_name, args?.routine_type);
|
|
1975
|
+
break;
|
|
1976
|
+
case 'bw_set_transformation_routine':
|
|
1977
|
+
text = await bwSetTransformationRoutine(client, args?.transformation_name, args?.routine_type, args?.transport);
|
|
1978
|
+
break;
|
|
1979
|
+
case 'bw_set_transformation_runtime':
|
|
1980
|
+
text = await bwSetTransformationRuntime(client, args?.transformation_name, args?.runtime, args?.transport);
|
|
1981
|
+
break;
|
|
1982
|
+
case 'bw_activate':
|
|
1983
|
+
text = await bwActivate(client, args?.object_type, args?.object_name, args?.lock_handle, args?.transport, args?.source_system);
|
|
1984
|
+
break;
|
|
1985
|
+
case 'bw_delete':
|
|
1986
|
+
text = await bwDelete(client, args?.object_type, args?.object_name);
|
|
1987
|
+
break;
|
|
1988
|
+
case 'bw_unlock':
|
|
1989
|
+
await client.unlock(args?.object_type, args?.object_name);
|
|
1990
|
+
text = JSON.stringify({ success: true, message: `Lock on ${(args?.object_type).toUpperCase()} '${args?.object_name}' released.` });
|
|
1991
|
+
break;
|
|
1992
|
+
case 'bw_get_infosource':
|
|
1993
|
+
text = await bwGetInfosource(client, args?.name);
|
|
1994
|
+
break;
|
|
1995
|
+
case 'bw_get_infoarea':
|
|
1996
|
+
text = await bwGetInfoarea(client, args?.name);
|
|
1997
|
+
break;
|
|
1998
|
+
case 'bw_create_infosource':
|
|
1999
|
+
text = await bwCreateInfosource(client, args?.name, args?.description, args?.info_area, args?.package ?? '$TMP', args?.copy_from_object_name, args?.copy_from_object_type, args?.copy_from_object_sub_type, args?.copy_from_source_system);
|
|
2000
|
+
break;
|
|
2001
|
+
case 'bw_update_infosource': {
|
|
2002
|
+
const rawFields = args?.fields;
|
|
2003
|
+
const fieldDefs = rawFields?.map((f) => ({
|
|
2004
|
+
name: f['name'],
|
|
2005
|
+
infoObjectName: f['infoobject_name'],
|
|
2006
|
+
type: f['type'],
|
|
2007
|
+
length: f['length'],
|
|
2008
|
+
label: f['label'],
|
|
2009
|
+
isKey: f['is_key'],
|
|
2010
|
+
aggregationBehavior: f['aggregation_behavior'],
|
|
2011
|
+
}));
|
|
2012
|
+
text = await bwUpdateInfosource(client, args?.name, args?.description, fieldDefs, args?.transport);
|
|
2013
|
+
break;
|
|
2014
|
+
}
|
|
2015
|
+
case 'bw_get_dtps':
|
|
2016
|
+
text = await bwGetDtps(client, args?.object_type, args?.object_name);
|
|
2017
|
+
break;
|
|
2018
|
+
case 'bw_get_dtp':
|
|
2019
|
+
text = await bwGetDtp(client, args?.dtp_name);
|
|
2020
|
+
break;
|
|
2021
|
+
case 'bw_get_process_chain':
|
|
2022
|
+
text = await bwGetProcessChain(client, args?.chain_name, args?.format ?? 'text', args?.include_variant_details !== false);
|
|
2023
|
+
break;
|
|
2024
|
+
case 'bw_get_process_variant':
|
|
2025
|
+
text = await bwGetProcessVariant(client, args?.process_type, args?.variant_name, args?.format ?? 'text');
|
|
2026
|
+
break;
|
|
2027
|
+
case 'bw_list_requests':
|
|
2028
|
+
text = await bwListRequests(client, args?.target, args?.target_type ?? 'ADSO', args?.storage ?? 'AQ,AX,AT', args?.status ?? 'N,GG,GR,YG,RR,YR,RG,U,Y,X', args?.top ?? 3, args?.created_from);
|
|
2029
|
+
break;
|
|
2030
|
+
case 'bw_get_request':
|
|
2031
|
+
text = await bwGetRequest(client, args?.request_tsn, args?.storage ?? 'AQ', args?.format ?? 'text');
|
|
2032
|
+
break;
|
|
2033
|
+
case 'bw_activate_request':
|
|
2034
|
+
text = await bwActivateRequest(args?.request_tsn, args?.storage ?? 'AQ');
|
|
2035
|
+
break;
|
|
2036
|
+
case 'bw_create_dtp':
|
|
2037
|
+
text = await bwCreateDtp(client, {
|
|
2038
|
+
trfn_name: args?.trfn_name,
|
|
2039
|
+
trfn_name_2: args?.trfn_name_2,
|
|
2040
|
+
source_name: args?.source_name,
|
|
2041
|
+
source_type: args?.source_type,
|
|
2042
|
+
source_system: args?.source_system,
|
|
2043
|
+
target_name: args?.target_name,
|
|
2044
|
+
target_type: args?.target_type,
|
|
2045
|
+
description: args?.description,
|
|
2046
|
+
package: args?.package,
|
|
2047
|
+
filter_field: args?.filter_field,
|
|
2048
|
+
filter_dta_name: args?.filter_dta_name,
|
|
2049
|
+
filter_value: args?.filter_value,
|
|
2050
|
+
});
|
|
2051
|
+
break;
|
|
2052
|
+
case 'bw_run_dtp':
|
|
2053
|
+
text = await bwRunDtp(args?.dtp_name);
|
|
2054
|
+
break;
|
|
2055
|
+
case 'bw_set_dtp_filter_routine':
|
|
2056
|
+
text = await bwSetDtpFilterRoutine(client, {
|
|
2057
|
+
dtp_name: args?.dtp_name,
|
|
2058
|
+
field_name: args?.field_name,
|
|
2059
|
+
routine_code: args?.routine_code,
|
|
2060
|
+
global_code: args?.global_code,
|
|
2061
|
+
});
|
|
2062
|
+
break;
|
|
2063
|
+
case 'bw_update_dtp':
|
|
2064
|
+
text = await bwUpdateDtp(client, {
|
|
2065
|
+
dtp_name: args?.dtp_name,
|
|
2066
|
+
description: args?.description,
|
|
2067
|
+
filter_field: args?.filter_field,
|
|
2068
|
+
filter_dta_name: args?.filter_dta_name,
|
|
2069
|
+
filter_value: args?.filter_value,
|
|
2070
|
+
filter_excluding: args?.filter_excluding,
|
|
2071
|
+
filter_clear_fields: args?.filter_clear_fields,
|
|
2072
|
+
extraction_mode: args?.extraction_mode,
|
|
2073
|
+
transport: args?.transport,
|
|
2074
|
+
transport_lock_holder: args?.transport_lock_holder,
|
|
2075
|
+
});
|
|
2076
|
+
break;
|
|
2077
|
+
case 'bw_get_push_schema':
|
|
2078
|
+
text = await bwGetPushSchema(args?.adso_name);
|
|
2079
|
+
break;
|
|
2080
|
+
case 'bw_push_data':
|
|
2081
|
+
text = await bwPushData(args?.adso_name, args?.records, args?.mode ?? 'one_step');
|
|
2082
|
+
break;
|
|
2083
|
+
case 'bw_get_query':
|
|
2084
|
+
text = await bwGetQuery(args?.query_name, args?.format ?? 'text');
|
|
2085
|
+
break;
|
|
2086
|
+
case 'bw_list_contents':
|
|
2087
|
+
text = await bwListContents(client, args?.path);
|
|
2088
|
+
break;
|
|
2089
|
+
case 'bw_list_source_systems':
|
|
2090
|
+
text = await bwListSourceSystems(client, args?.source_system_type);
|
|
2091
|
+
break;
|
|
2092
|
+
case 'bw_list_datasources':
|
|
2093
|
+
text = await bwListDatasources(client, args?.source_system, args?.format ?? 'text', args?.apco_path_filter);
|
|
2094
|
+
break;
|
|
2095
|
+
case 'bw_get_source_system':
|
|
2096
|
+
text = await bwGetSourceSystem(client, args?.source_system);
|
|
2097
|
+
break;
|
|
2098
|
+
case 'bw_get_datasource':
|
|
2099
|
+
text = await bwGetDatasource(client, args?.datasource_name, args?.source_system, args?.format ?? 'text');
|
|
2100
|
+
break;
|
|
2101
|
+
case 'bw_preview_datasource':
|
|
2102
|
+
text = await bwPreviewDatasource(client, args?.datasource_name, args?.source_system, args?.records ?? 20);
|
|
2103
|
+
break;
|
|
2104
|
+
case 'bw_get_composite_provider':
|
|
2105
|
+
text = await bwGetCompositeProvider(client, args?.composite_provider_name);
|
|
2106
|
+
break;
|
|
2107
|
+
case 'bw_get_ckf':
|
|
2108
|
+
text = await bwGetCkf(client, args?.component_name);
|
|
2109
|
+
break;
|
|
2110
|
+
case 'bw_get_rkf':
|
|
2111
|
+
text = await bwGetRkf(client, args?.component_name);
|
|
2112
|
+
break;
|
|
2113
|
+
case 'bw_get_structure':
|
|
2114
|
+
text = await bwGetStructure(client, args?.component_name);
|
|
2115
|
+
break;
|
|
2116
|
+
case 'bw_query_data': {
|
|
2117
|
+
const rawState = args?.state;
|
|
2118
|
+
const state = rawState
|
|
2119
|
+
? {
|
|
2120
|
+
infoObjects: rawState.infoObjects.map((io) => ({
|
|
2121
|
+
name: io['name'],
|
|
2122
|
+
id: io['id'],
|
|
2123
|
+
axis: io['axis'],
|
|
2124
|
+
hierarchy: io['hierarchy'],
|
|
2125
|
+
filterValues: io['filterValues'],
|
|
2126
|
+
})),
|
|
2127
|
+
}
|
|
2128
|
+
: undefined;
|
|
2129
|
+
const rawVars = args?.variables;
|
|
2130
|
+
const variables = rawVars?.map((v) => ({
|
|
2131
|
+
name: v['name'],
|
|
2132
|
+
id: v['id'],
|
|
2133
|
+
txt: v['txt'],
|
|
2134
|
+
altName: v['altName'],
|
|
2135
|
+
type: v['type'],
|
|
2136
|
+
inputEnabled: v['inputEnabled'],
|
|
2137
|
+
mandatory: v['mandatory'],
|
|
2138
|
+
iobj: v['iobj'],
|
|
2139
|
+
values: v['values'],
|
|
2140
|
+
}));
|
|
2141
|
+
const rawDrillOps = args?.drill_operations;
|
|
2142
|
+
const drillOperations = rawDrillOps?.map((op) => ({
|
|
2143
|
+
axis: op['axis'],
|
|
2144
|
+
drill_state: op['drill_state'],
|
|
2145
|
+
tuple_idx: op['tuple_idx'],
|
|
2146
|
+
element_idx: op['element_idx'],
|
|
2147
|
+
}));
|
|
2148
|
+
text = await bwQueryData(client, args?.comp_id, args?.is_provider ?? false, args?.format ?? 'text', state, variables, args?.from_row ?? 0, args?.to_row ?? 1000, drillOperations);
|
|
2149
|
+
break;
|
|
2150
|
+
}
|
|
2151
|
+
case 'bw_get_filter_values':
|
|
2152
|
+
text = await bwGetFilterValues(client, args?.characteristic_name, args?.search_string, args?.info_provider, args?.max_rows ?? 201);
|
|
2153
|
+
break;
|
|
2154
|
+
case 'bw_get_roles':
|
|
2155
|
+
text = await bwGetRoles(client, args?.role_filter);
|
|
2156
|
+
break;
|
|
2157
|
+
case 'bw_get_query_roles':
|
|
2158
|
+
text = await bwGetQueryRoles(client, args?.query_name);
|
|
2159
|
+
break;
|
|
2160
|
+
case 'bw_set_query_roles':
|
|
2161
|
+
text = await bwSetQueryRoles(client, args?.query_name, args?.action, args?.target_name, args?.target_type, args?.parent_role_name);
|
|
2162
|
+
break;
|
|
2163
|
+
case 'bw_get_role_queries':
|
|
2164
|
+
text = await bwGetRoleQueries(client, args?.role_name);
|
|
2165
|
+
break;
|
|
2166
|
+
case 'bw_get_dataflow':
|
|
2167
|
+
text = await bwGetDataflow(client, args?.object_name, args?.object_type, args?.source_system, args?.direction ?? 'both', args?.levels ?? -1, args?.format ?? 'text');
|
|
2168
|
+
break;
|
|
2169
|
+
default:
|
|
2170
|
+
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
2171
|
+
}
|
|
2172
|
+
return { content: [{ type: 'text', text }] };
|
|
2173
|
+
}
|
|
2174
|
+
catch (error) {
|
|
2175
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2176
|
+
// Return as error content so Claude can see the details
|
|
2177
|
+
return {
|
|
2178
|
+
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
2179
|
+
isError: true,
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2182
|
+
});
|
|
2183
|
+
// ── Start ─────────────────────────────────────────────────────────────────────
|
|
2184
|
+
async function main() {
|
|
2185
|
+
try {
|
|
2186
|
+
await client.loadMediaTypes();
|
|
2187
|
+
}
|
|
2188
|
+
catch (err) {
|
|
2189
|
+
process.stderr.write(`[bw-modeling-mcp] Warning: discovery failed, using hardcoded media type fallbacks (${err})\n`);
|
|
2190
|
+
}
|
|
2191
|
+
const transport = new StdioServerTransport();
|
|
2192
|
+
await server.connect(transport);
|
|
2193
|
+
// Log to stderr only (stdout is used for MCP protocol messages)
|
|
2194
|
+
process.stderr.write('bw-modeling-mcp server started\n');
|
|
2195
|
+
}
|
|
2196
|
+
main().catch((err) => {
|
|
2197
|
+
process.stderr.write(`Fatal error: ${err}\n`);
|
|
2198
|
+
process.exit(1);
|
|
2199
|
+
});
|