MCPcopy Index your code
hub / github.com/IBM/AssetOpsBench / main

Function main

examples/quickstart_tooluniverse.py:19–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def main():
20 tu = ToolUniverse() # 1. init
21 try:
22 tu.load_tools(servers=["iot", "fmsr", "wo"]) # 2. load (connect + discover)
23
24 show("find 'failure mode'",
25 [s["name"] for s in tu.find_tools("failure mode")])
26
27 # 3. run a single tool (ToolUniverse dict form)
28 show("iot.sensors", tu.run({
29 "name": "iot.sensors",
30 "arguments": {"site_name": "MAIN", "asset_id": "Chiller 6"},
31 }))
32
33 # A workflow runs through the same entrypoint
34 show("chiller_triage", tu.run({
35 "name": "chiller_triage",
36 "arguments": {"asset_id": "Chiller 6", "raise_work_order": False},
37 }))
38 finally:
39 tu.close()
40
41
42if __name__ == "__main__":

Callers 1

Calls 6

load_toolsMethod · 0.95
find_toolsMethod · 0.95
runMethod · 0.95
closeMethod · 0.95
ToolUniverseClass · 0.90
showFunction · 0.85

Tested by

no test coverage detected