pyxecm 3.6.1__tar.gz → 3.6.2__tar.gz
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.
- {pyxecm-3.6.1 → pyxecm-3.6.2}/PKG-INFO +1 -1
- {pyxecm-3.6.1 → pyxecm-3.6.2}/pyproject.toml +1 -1
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otca.py +60 -12
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otcs.py +20 -6
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/payload.py +143 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/.gitignore +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/README.md +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/avts.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/coreshare.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/helper/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/helper/assoc.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/helper/data.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/helper/logadapter.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/helper/web.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/helper/xml.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otac.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otawp.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otds.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otiv.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otkd.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otmm.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/otpd.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm/py.typed +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/__main__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/app.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/auth/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/auth/functions.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/auth/models.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/auth/router.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/common/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/common/functions.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/common/metrics.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/common/models.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/common/router.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/settings.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/terminal/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/terminal/router.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_maintenance/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_maintenance/functions.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_maintenance/models.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_maintenance/router.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_otcs/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_otcs/functions.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_otcs/router.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_payload/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_payload/functions.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_payload/models.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_api/v1_payload/router.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/__main__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/browser_automation.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/customizer.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/exceptions.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/guidewire.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/k8s.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/log.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/m365.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/payload_list.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/salesforce.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/sap.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/servicenow.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/settings.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/successfactors.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_customizer/translate.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_maintenance_page/__init__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_maintenance_page/__main__.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_maintenance_page/app.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_maintenance_page/settings.py +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_maintenance_page/static/favicon.avif +0 -0
- {pyxecm-3.6.1 → pyxecm-3.6.2}/src/pyxecm_maintenance_page/templates/maintenance.html +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pyxecm
|
|
3
|
-
Version: 3.6.
|
|
3
|
+
Version: 3.6.2
|
|
4
4
|
Summary: A Python library to interact with Opentext Content Management Rest API
|
|
5
5
|
Project-URL: Homepage, https://github.com/opentext/pyxecm
|
|
6
6
|
Author-email: Kai Gatzweiler <kgatzweiler@opentext.com>, "Dr. Marc Diefenbruch" <mdiefenb@opentext.com>
|
|
@@ -122,18 +122,22 @@ class OTCA:
|
|
|
122
122
|
# Stats endpoint:
|
|
123
123
|
otca_config["usageStatsUrl"] = base_url + "/v1/usage-stats"
|
|
124
124
|
|
|
125
|
+
# Tools Url
|
|
126
|
+
tools_url = base_url + "/v1/tools"
|
|
127
|
+
otca_config["toolsUrl"] = tools_url
|
|
128
|
+
|
|
125
129
|
# MCP Client endpoints:
|
|
126
|
-
|
|
127
|
-
otca_config["
|
|
128
|
-
otca_config["
|
|
129
|
-
otca_config["
|
|
130
|
+
mcp_client_url = base_url + "/mcp-client"
|
|
131
|
+
otca_config["mcpClientServersUrl"] = mcp_client_url + "/servers"
|
|
132
|
+
otca_config["mcpClientToolsUrl"] = mcp_client_url + "/tools"
|
|
133
|
+
otca_config["mcpClientToolsRefreshUrl"] = otca_config["mcpClientToolsUrl"] + "/refresh"
|
|
134
|
+
otca_config["mcpClientToolsSyncUrl"] = otca_config["mcpClientToolsUrl"] + "/sync"
|
|
135
|
+
otca_config["mcpClientHealthUrl"] = mcp_client_url + "/health"
|
|
130
136
|
|
|
131
137
|
# MCP Server endpoints:
|
|
132
|
-
|
|
133
|
-
otca_config["
|
|
134
|
-
otca_config["
|
|
135
|
-
otca_config["mcpServerDeleteToolsUrl"] = base_url + "/mcp-server/tools"
|
|
136
|
-
otca_config["mcpServerHealthUrl"] = base_url + "/mcp-server/health"
|
|
138
|
+
mcp_server_url = base_url + "/mcp-server"
|
|
139
|
+
otca_config["mcpServerToolsUrl"] = mcp_server_url + "/tools"
|
|
140
|
+
otca_config["mcpServerHealthUrl"] = mcp_server_url + "/health"
|
|
137
141
|
|
|
138
142
|
otca_config["contentSystem"] = self.get_content_system()
|
|
139
143
|
otca_config["clientId"] = client_id
|
|
@@ -1268,6 +1272,27 @@ class OTCA:
|
|
|
1268
1272
|
|
|
1269
1273
|
# end method definition
|
|
1270
1274
|
|
|
1275
|
+
def get_tools(self) -> list | None:
|
|
1276
|
+
"""List all tools available from remote MCP servers.
|
|
1277
|
+
|
|
1278
|
+
Returns:
|
|
1279
|
+
list | None:
|
|
1280
|
+
List of available MCP tools or None in case of an error.
|
|
1281
|
+
|
|
1282
|
+
"""
|
|
1283
|
+
|
|
1284
|
+
request_url = self.config()["toolsUrl"]
|
|
1285
|
+
request_header = self.request_header(service_type="user")
|
|
1286
|
+
|
|
1287
|
+
return self.do_request(
|
|
1288
|
+
url=request_url,
|
|
1289
|
+
method="GET",
|
|
1290
|
+
headers=request_header,
|
|
1291
|
+
failure_message="Canbnot get list of tools",
|
|
1292
|
+
)
|
|
1293
|
+
|
|
1294
|
+
# end method definition
|
|
1295
|
+
|
|
1271
1296
|
# --- MCP Client Methods ---
|
|
1272
1297
|
|
|
1273
1298
|
def create_mcp_server(self, server_config: dict) -> dict | None:
|
|
@@ -1410,6 +1435,29 @@ class OTCA:
|
|
|
1410
1435
|
list | None:
|
|
1411
1436
|
List of available MCP tools or None in case of an error.
|
|
1412
1437
|
|
|
1438
|
+
Example:
|
|
1439
|
+
[
|
|
1440
|
+
{
|
|
1441
|
+
'id': 2,
|
|
1442
|
+
'key': 'ALLOWED_MCP_TOOLS',
|
|
1443
|
+
'value': [
|
|
1444
|
+
{
|
|
1445
|
+
'name': 'current_time',
|
|
1446
|
+
'description': 'Use this to get the current date and time, return it as a string.'
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
'name': 'otcm_recman_agent',
|
|
1450
|
+
'description': "Invoke Records Management agent and its related tools."
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
'name': 'otcm_workspace_agent',
|
|
1454
|
+
'description': "Invoke the workspace operations agent for OpenText Content Management.'
|
|
1455
|
+
}
|
|
1456
|
+
],
|
|
1457
|
+
'subscription_id': None
|
|
1458
|
+
}
|
|
1459
|
+
]
|
|
1460
|
+
|
|
1413
1461
|
"""
|
|
1414
1462
|
|
|
1415
1463
|
request_url = self.config()["mcpClientToolsUrl"]
|
|
@@ -1476,7 +1524,7 @@ class OTCA:
|
|
|
1476
1524
|
|
|
1477
1525
|
"""
|
|
1478
1526
|
|
|
1479
|
-
request_url = self.config()["
|
|
1527
|
+
request_url = self.config()["mcpServerToolsUrl"]
|
|
1480
1528
|
request_header = self.request_header(service_type="user")
|
|
1481
1529
|
|
|
1482
1530
|
return self.do_request(
|
|
@@ -1501,7 +1549,7 @@ class OTCA:
|
|
|
1501
1549
|
|
|
1502
1550
|
"""
|
|
1503
1551
|
|
|
1504
|
-
request_url = self.config()["
|
|
1552
|
+
request_url = self.config()["mcpServerToolsUrl"]
|
|
1505
1553
|
request_header = self.request_header(service_type="user")
|
|
1506
1554
|
|
|
1507
1555
|
return self.do_request(
|
|
@@ -1548,7 +1596,7 @@ class OTCA:
|
|
|
1548
1596
|
|
|
1549
1597
|
"""
|
|
1550
1598
|
|
|
1551
|
-
request_url = self.config()["
|
|
1599
|
+
request_url = self.config()["mcpServerToolsUrl"]
|
|
1552
1600
|
request_header = self.request_header(service_type="user")
|
|
1553
1601
|
|
|
1554
1602
|
return self.do_request(
|
|
@@ -27519,7 +27519,13 @@ class OTCS:
|
|
|
27519
27519
|
workspace_id,
|
|
27520
27520
|
)
|
|
27521
27521
|
return None
|
|
27522
|
-
template_names = [
|
|
27522
|
+
template_names = [
|
|
27523
|
+
item.text for item in root.findall("startup/processing/templates/template") if item is not None
|
|
27524
|
+
]
|
|
27525
|
+
# below for scenarios where they only configure one template for testing
|
|
27526
|
+
if not template_names:
|
|
27527
|
+
# A single template appears only in startup/processing/template instead
|
|
27528
|
+
template_names = [item.text for item in root.findall("startup/processing/template") if item is not None]
|
|
27523
27529
|
|
|
27524
27530
|
return template_names
|
|
27525
27531
|
|
|
@@ -29199,11 +29205,19 @@ class OTCS:
|
|
|
29199
29205
|
if isinstance(due_in, dict):
|
|
29200
29206
|
map_value(due_in, "due_in_unit", self.REMINDER_UNIT_NAMES)
|
|
29201
29207
|
seq_repeat = schedule.get("seq_repeat")
|
|
29202
|
-
if
|
|
29203
|
-
|
|
29204
|
-
|
|
29205
|
-
|
|
29206
|
-
|
|
29208
|
+
if seq_repeat:
|
|
29209
|
+
if "Every day" in seq_repeat:
|
|
29210
|
+
schedule["repeat_on"] = OTCS.REMINDER_SEQUENCE_MAP.get("daily")
|
|
29211
|
+
if "Every 2 weeks" in seq_repeat:
|
|
29212
|
+
schedule["repeat_on"] = OTCS.REMINDER_SEQUENCE_MAP.get("bi-weekly")
|
|
29213
|
+
elif "Every 2 months" in seq_repeat:
|
|
29214
|
+
schedule["repeat_on"] = OTCS.REMINDER_SEQUENCE_MAP.get("every 2 months")
|
|
29215
|
+
elif "every 3 months" in seq_repeat:
|
|
29216
|
+
schedule["repeat_on"] = OTCS.REMINDER_SEQUENCE_MAP.get("quarterly")
|
|
29217
|
+
elif "every 6 months" in seq_repeat:
|
|
29218
|
+
schedule["repeat_on"] = OTCS.REMINDER_SEQUENCE_MAP.get("semi-annually")
|
|
29219
|
+
elif "Every year" in seq_repeat:
|
|
29220
|
+
schedule["repeat_on"] = OTCS.REMINDER_SEQUENCE_MAP.get("yearly")
|
|
29207
29221
|
|
|
29208
29222
|
# OTCS reports this flag as 0 / 1 while the reminder methods take a boolean:
|
|
29209
29223
|
if isinstance(followup.get("activation_by_day"), int):
|
|
@@ -608,6 +608,7 @@ class Payload:
|
|
|
608
608
|
self._embeddings = self.get_payload_section("embeddings")
|
|
609
609
|
self._nifi_flows = self.get_payload_section("nifi")
|
|
610
610
|
self._aviator_mcp_servers = self.get_payload_section("aviatorMcpServers")
|
|
611
|
+
self._aviator_mcp_tools = self.get_payload_section("aviatorMcpTools")
|
|
611
612
|
|
|
612
613
|
return self._payload
|
|
613
614
|
|
|
@@ -2951,6 +2952,14 @@ class Payload:
|
|
|
2951
2952
|
self.logger.warning(
|
|
2952
2953
|
"aviatorMcpServers in payload but Content Aviator (OTCA) is not configured! MCP servers will not be processed.",
|
|
2953
2954
|
)
|
|
2955
|
+
case "aviatorMcpTools":
|
|
2956
|
+
if self._otca and isinstance(self._otca, OTCA):
|
|
2957
|
+
self._log_header_callback("Process Aviator MCP Tools")
|
|
2958
|
+
self.process_mcp_tools()
|
|
2959
|
+
else:
|
|
2960
|
+
self.logger.warning(
|
|
2961
|
+
"aviatorMcpTools in payload but Content Aviator (OTCA) is not configured! MCP tools will not be processed.",
|
|
2962
|
+
)
|
|
2954
2963
|
case _:
|
|
2955
2964
|
self.logger.error(
|
|
2956
2965
|
"Illegal payload section name -> '%s' in payloadSections!",
|
|
@@ -32224,3 +32233,137 @@ class Payload:
|
|
|
32224
32233
|
return success
|
|
32225
32234
|
|
|
32226
32235
|
# end method definition
|
|
32236
|
+
|
|
32237
|
+
@tracer.start_as_current_span(attributes=OTEL_TRACING_ATTRIBUTES, name="process_mcp_tools")
|
|
32238
|
+
def process_mcp_tools(self, section_name: str = "aviatorMcpTools") -> bool:
|
|
32239
|
+
"""Register Content Aviator agents as MCP tools.
|
|
32240
|
+
|
|
32241
|
+
Payload item keys:
|
|
32242
|
+
- enabled (bool, optional, default=True)
|
|
32243
|
+
- name (str, required)
|
|
32244
|
+
|
|
32245
|
+
Args:
|
|
32246
|
+
section_name (str, optional):
|
|
32247
|
+
The name of the payload section. It can be overridden
|
|
32248
|
+
for cases where multiple sections of same type
|
|
32249
|
+
are used (e.g. the "Post" sections).
|
|
32250
|
+
This name is also used for the "success" status
|
|
32251
|
+
files written to the Admin Personal Workspace.
|
|
32252
|
+
|
|
32253
|
+
Returns:
|
|
32254
|
+
bool:
|
|
32255
|
+
True, if payload has been processed without errors, False otherwise.
|
|
32256
|
+
|
|
32257
|
+
"""
|
|
32258
|
+
|
|
32259
|
+
if not self._aviator_mcp_tools:
|
|
32260
|
+
self.logger.info(
|
|
32261
|
+
"Payload section -> '%s' is empty. Skipping...",
|
|
32262
|
+
section_name,
|
|
32263
|
+
)
|
|
32264
|
+
return True
|
|
32265
|
+
|
|
32266
|
+
# If this payload section has been processed successfully before we
|
|
32267
|
+
# can return True and skip processing it once more:
|
|
32268
|
+
if self.check_status_file(payload_section_name=section_name):
|
|
32269
|
+
return True
|
|
32270
|
+
|
|
32271
|
+
success: bool = True
|
|
32272
|
+
|
|
32273
|
+
# list_mcp_tools() returns a list of settings entries (e.g. key -> 'ALLOWED_MCP_TOOLS')
|
|
32274
|
+
# whose "value" is the actual list of tool dictionaries with "name" and "description":
|
|
32275
|
+
existing_mcp_tools = self._otca.list_registered_mcp_tools()
|
|
32276
|
+
if existing_mcp_tools is None:
|
|
32277
|
+
self.logger.warning(
|
|
32278
|
+
"Failed to retrieve the list of available MCP tools from Content Aviator. Cannot check if tools are already registered."
|
|
32279
|
+
)
|
|
32280
|
+
|
|
32281
|
+
existing_mcp_tool_names = [
|
|
32282
|
+
tool.get("name")
|
|
32283
|
+
for entry in existing_mcp_tools or []
|
|
32284
|
+
for tool in entry.get("value") or []
|
|
32285
|
+
if tool.get("name")
|
|
32286
|
+
]
|
|
32287
|
+
if existing_mcp_tool_names:
|
|
32288
|
+
self.logger.info(
|
|
32289
|
+
"Already registered MCP tools in Content Aviator: %s",
|
|
32290
|
+
", ".join(existing_mcp_tool_names),
|
|
32291
|
+
)
|
|
32292
|
+
|
|
32293
|
+
for mcp_tool in self._aviator_mcp_tools:
|
|
32294
|
+
tool_name = mcp_tool.get("name")
|
|
32295
|
+
if not tool_name:
|
|
32296
|
+
self.logger.error("Content Aviator MCP tool needs a name in payload! Skipping...")
|
|
32297
|
+
success = False
|
|
32298
|
+
continue
|
|
32299
|
+
|
|
32300
|
+
# Check if element has been disabled in payload (enabled = false).
|
|
32301
|
+
# In this case we skip the element:
|
|
32302
|
+
if not mcp_tool.get("enabled", True):
|
|
32303
|
+
self.logger.info(
|
|
32304
|
+
"Payload for Content Aviator MCP tool -> '%s' is disabled. Skipping...",
|
|
32305
|
+
tool_name,
|
|
32306
|
+
)
|
|
32307
|
+
continue
|
|
32308
|
+
|
|
32309
|
+
if tool_name in existing_mcp_tool_names:
|
|
32310
|
+
self.logger.info(
|
|
32311
|
+
"Content Aviator MCP tool -> '%s' is already registered in Content Aviator. No need to register it again. Skipping...",
|
|
32312
|
+
tool_name,
|
|
32313
|
+
)
|
|
32314
|
+
continue
|
|
32315
|
+
|
|
32316
|
+
response = self._otca.register_mcp_tools(tools=[tool_name])
|
|
32317
|
+
if response:
|
|
32318
|
+
tool_id = response.get("id", "Unknown ID")
|
|
32319
|
+
# The response value is the complete list of tools registered for the
|
|
32320
|
+
# tenant - we need to pick the entry of the tool we just registered:
|
|
32321
|
+
value = response.get("value") or []
|
|
32322
|
+
tool_entry = next((entry for entry in value if entry.get("name") == tool_name), None)
|
|
32323
|
+
if tool_entry is None:
|
|
32324
|
+
self.logger.warning(
|
|
32325
|
+
"Content Aviator MCP tool -> '%s' is not included in the registration response!",
|
|
32326
|
+
tool_name,
|
|
32327
|
+
)
|
|
32328
|
+
tool_description = (
|
|
32329
|
+
tool_entry.get("description", "Unknown Description") if tool_entry else "Unknown Description"
|
|
32330
|
+
)
|
|
32331
|
+
self.logger.info(
|
|
32332
|
+
"Registered Content Aviator MCP tool -> '%s' (%s).",
|
|
32333
|
+
tool_name,
|
|
32334
|
+
tool_id,
|
|
32335
|
+
)
|
|
32336
|
+
mcp_tool["id"] = tool_id # record the ID of the MCP tool settings record in the payload
|
|
32337
|
+
mcp_tool["description"] = tool_description # record the created tool description in the payload
|
|
32338
|
+
mcp_tool["registered"] = True
|
|
32339
|
+
else:
|
|
32340
|
+
self.logger.error(
|
|
32341
|
+
"Failed to register Content Aviator MCP tool -> '%s'!",
|
|
32342
|
+
tool_name,
|
|
32343
|
+
)
|
|
32344
|
+
mcp_tool["registered"] = False
|
|
32345
|
+
success = False
|
|
32346
|
+
# end for mcp_tool in self._aviator_mcp_tools
|
|
32347
|
+
|
|
32348
|
+
registered_tools = [tool.get("name") for tool in self._aviator_mcp_tools if tool.get("registered") is True]
|
|
32349
|
+
if registered_tools:
|
|
32350
|
+
self.logger.info(
|
|
32351
|
+
"Successfully registered the following additional MCP tools: %s",
|
|
32352
|
+
registered_tools,
|
|
32353
|
+
)
|
|
32354
|
+
failed_tools = [tool.get("name") for tool in self._aviator_mcp_tools if tool.get("registered") is False]
|
|
32355
|
+
if failed_tools:
|
|
32356
|
+
self.logger.info(
|
|
32357
|
+
"Failed to register the following MCP tools: %s",
|
|
32358
|
+
failed_tools,
|
|
32359
|
+
)
|
|
32360
|
+
|
|
32361
|
+
self.write_status_file(
|
|
32362
|
+
success=success,
|
|
32363
|
+
payload_section_name=section_name,
|
|
32364
|
+
payload_section=self._aviator_mcp_tools,
|
|
32365
|
+
)
|
|
32366
|
+
|
|
32367
|
+
return success
|
|
32368
|
+
|
|
32369
|
+
# end method definition
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|