trustgraph-cli 1.1.9__tar.gz → 1.1.10__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.

Potentially problematic release.


This version of trustgraph-cli might be problematic. Click here for more details.

Files changed (60) hide show
  1. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/PKG-INFO +2 -2
  2. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-delete-mcp-tool +16 -16
  3. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-delete-tool +2 -29
  4. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-init-trustgraph +21 -1
  5. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-set-mcp-tool +36 -18
  6. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-set-tool +59 -28
  7. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-mcp-tools +2 -3
  8. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-tools +28 -22
  9. trustgraph-cli-1.1.10/trustgraph/cli_version.py +1 -0
  10. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/trustgraph_cli.egg-info/PKG-INFO +2 -2
  11. trustgraph-cli-1.1.9/trustgraph/cli_version.py +0 -1
  12. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/README.md +0 -0
  13. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-add-library-document +0 -0
  14. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-delete-flow-class +0 -0
  15. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-delete-kg-core +0 -0
  16. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-dump-msgpack +0 -0
  17. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-get-flow-class +0 -0
  18. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-get-kg-core +0 -0
  19. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-graph-to-turtle +0 -0
  20. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-invoke-agent +0 -0
  21. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-invoke-document-rag +0 -0
  22. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-invoke-graph-rag +0 -0
  23. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-invoke-llm +0 -0
  24. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-invoke-mcp-tool +0 -0
  25. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-invoke-prompt +0 -0
  26. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-load-doc-embeds +0 -0
  27. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-load-kg-core +0 -0
  28. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-load-pdf +0 -0
  29. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-load-sample-documents +0 -0
  30. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-load-text +0 -0
  31. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-load-turtle +0 -0
  32. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-put-flow-class +0 -0
  33. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-put-kg-core +0 -0
  34. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-remove-library-document +0 -0
  35. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-save-doc-embeds +0 -0
  36. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-set-prompt +0 -0
  37. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-set-token-costs +0 -0
  38. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-config +0 -0
  39. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-flow-classes +0 -0
  40. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-flow-state +0 -0
  41. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-flows +0 -0
  42. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-graph +0 -0
  43. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-kg-cores +0 -0
  44. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-library-documents +0 -0
  45. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-library-processing +0 -0
  46. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-processor-state +0 -0
  47. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-prompts +0 -0
  48. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-token-costs +0 -0
  49. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-show-token-rate +0 -0
  50. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-start-flow +0 -0
  51. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-start-library-processing +0 -0
  52. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-stop-flow +0 -0
  53. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-stop-library-processing +0 -0
  54. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/scripts/tg-unload-kg-core +0 -0
  55. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/setup.cfg +0 -0
  56. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/setup.py +0 -0
  57. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/trustgraph_cli.egg-info/SOURCES.txt +0 -0
  58. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/trustgraph_cli.egg-info/dependency_links.txt +0 -0
  59. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/trustgraph_cli.egg-info/requires.txt +0 -0
  60. {trustgraph-cli-1.1.9 → trustgraph-cli-1.1.10}/trustgraph_cli.egg-info/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-cli
3
- Version: 1.1.9
3
+ Version: 1.1.10
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Home-page: https://github.com/trustgraph-ai/trustgraph
6
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v1.1.9.tar.gz
6
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v1.1.10.tar.gz
7
7
  Author: trustgraph.ai
8
8
  Author-email: security@trustgraph.ai
9
9
  Classifier: Programming Language :: Python :: 3
@@ -2,7 +2,7 @@
2
2
 
3
3
  """
4
4
  Deletes MCP (Model Control Protocol) tools from the TrustGraph system.
5
- Removes MCP tool configurations by name from the 'mcp' configuration group.
5
+ Removes MCP tool configurations by ID from the 'mcp' configuration group.
6
6
  """
7
7
 
8
8
  import argparse
@@ -14,7 +14,7 @@ default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
14
14
 
15
15
  def delete_mcp_tool(
16
16
  url : str,
17
- name : str,
17
+ id : str,
18
18
  ):
19
19
 
20
20
  api = Api(url).config()
@@ -22,28 +22,28 @@ def delete_mcp_tool(
22
22
  # Check if the tool exists first
23
23
  try:
24
24
  values = api.get([
25
- ConfigKey(type="mcp", key=name)
25
+ ConfigKey(type="mcp", key=id)
26
26
  ])
27
27
 
28
28
  if not values or not values[0].value:
29
- print(f"MCP tool '{name}' not found.")
29
+ print(f"MCP tool '{id}' not found.")
30
30
  return False
31
31
 
32
32
  except Exception as e:
33
- print(f"MCP tool '{name}' not found.")
33
+ print(f"MCP tool '{id}' not found.")
34
34
  return False
35
35
 
36
36
  # Delete the MCP tool configuration from the 'mcp' group
37
37
  try:
38
38
  api.delete([
39
- ConfigKey(type="mcp", key=name)
39
+ ConfigKey(type="mcp", key=id)
40
40
  ])
41
41
 
42
- print(f"MCP tool '{name}' deleted successfully.")
42
+ print(f"MCP tool '{id}' deleted successfully.")
43
43
  return True
44
44
 
45
45
  except Exception as e:
46
- print(f"Error deleting MCP tool '{name}': {e}")
46
+ print(f"Error deleting MCP tool '{id}': {e}")
47
47
  return False
48
48
 
49
49
  def main():
@@ -56,9 +56,9 @@ def main():
56
56
  Once deleted, the tool will no longer be available for use.
57
57
 
58
58
  Examples:
59
- %(prog)s --name weather
60
- %(prog)s --name calculator
61
- %(prog)s --api-url http://localhost:9000/ --name file-reader
59
+ %(prog)s --id weather
60
+ %(prog)s --id calculator
61
+ %(prog)s --api-url http://localhost:9000/ --id file-reader
62
62
  ''').strip(),
63
63
  formatter_class=argparse.RawDescriptionHelpFormatter
64
64
  )
@@ -70,21 +70,21 @@ def main():
70
70
  )
71
71
 
72
72
  parser.add_argument(
73
- '--name',
73
+ '--id',
74
74
  required=True,
75
- help='MCP tool name to delete',
75
+ help='MCP tool ID to delete',
76
76
  )
77
77
 
78
78
  args = parser.parse_args()
79
79
 
80
80
  try:
81
81
 
82
- if not args.name:
83
- raise RuntimeError("Must specify --name for MCP tool to delete")
82
+ if not args.id:
83
+ raise RuntimeError("Must specify --id for MCP tool to delete")
84
84
 
85
85
  delete_mcp_tool(
86
86
  url=args.api_url,
87
- name=args.name
87
+ id=args.id
88
88
  )
89
89
 
90
90
  except Exception as e:
@@ -21,27 +21,10 @@ def delete_tool(
21
21
 
22
22
  api = Api(url).config()
23
23
 
24
- # Get the current tool index
25
- try:
26
- values = api.get([
27
- ConfigKey(type="agent", key="tool-index")
28
- ])
29
-
30
- ix = json.loads(values[0].value)
31
-
32
- except Exception as e:
33
- print(f"Error reading tool index: {e}")
34
- return False
35
-
36
- # Check if the tool exists in the index
37
- if id not in ix:
38
- print(f"Tool '{id}' not found in tool index.")
39
- return False
40
-
41
24
  # Check if the tool configuration exists
42
25
  try:
43
26
  tool_values = api.get([
44
- ConfigKey(type="agent", key=f"tool.{id}")
27
+ ConfigKey(type="tool", key=id)
45
28
  ])
46
29
 
47
30
  if not tool_values or not tool_values[0].value:
@@ -52,22 +35,12 @@ def delete_tool(
52
35
  print(f"Tool configuration for '{id}' not found.")
53
36
  return False
54
37
 
55
- # Remove the tool ID from the index
56
- ix.remove(id)
57
-
58
38
  # Delete the tool configuration and update the index
59
39
  try:
60
40
 
61
- # Update the tool index
62
- api.put([
63
- ConfigValue(
64
- type="agent", key="tool-index", value=json.dumps(ix)
65
- )
66
- ])
67
-
68
41
  # Delete the tool configuration
69
42
  api.delete([
70
- ConfigKey(type="agent", key=f"tool.{id}")
43
+ ConfigKey(type="tool", key=id)
71
44
  ])
72
45
 
73
46
  print(f"Tool '{id}' deleted successfully.")
@@ -118,7 +118,10 @@ def ensure_config(config, pulsar_host, pulsar_api_key):
118
118
  print("Retrying...", flush=True)
119
119
  continue
120
120
 
121
- def init(pulsar_admin_url, pulsar_host, pulsar_api_key, config, tenant):
121
+ def init(
122
+ pulsar_admin_url, pulsar_host, pulsar_api_key, tenant,
123
+ config, config_file,
124
+ ):
122
125
 
123
126
  clusters = get_clusters(pulsar_admin_url)
124
127
 
@@ -156,6 +159,18 @@ def init(pulsar_admin_url, pulsar_host, pulsar_api_key, config, tenant):
156
159
 
157
160
  ensure_config(dec, pulsar_host, pulsar_api_key)
158
161
 
162
+ elif config_file is not None:
163
+
164
+ try:
165
+ print("Decoding config...", flush=True)
166
+ dec = json.load(open(config_file))
167
+ print("Decoded.", flush=True)
168
+ except Exception as e:
169
+ print("Exception:", e, flush=True)
170
+ raise e
171
+
172
+ ensure_config(dec, pulsar_host, pulsar_api_key)
173
+
159
174
  else:
160
175
  print("No config to update.", flush=True)
161
176
 
@@ -188,6 +203,11 @@ def main():
188
203
  help=f'Initial configuration to load',
189
204
  )
190
205
 
206
+ parser.add_argument(
207
+ '-C', '--config-file',
208
+ help=f'Initial configuration to load from file',
209
+ )
210
+
191
211
  parser.add_argument(
192
212
  '-t', '--tenant',
193
213
  default="tg",
@@ -1,10 +1,17 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
3
  """
4
- Configures and registers MCP (Model Control Protocol) tools in the
5
- TrustGraph system. Allows defining MCP tool configurations with name and
6
- URL. Tools are stored in the 'mcp' configuration group for discovery and
7
- execution.
4
+ Configures and registers MCP (Model Context Protocol) tools in the
5
+ TrustGraph system.
6
+
7
+ MCP tools are external services that follow the Model Context Protocol
8
+ specification. This script stores MCP tool configurations with:
9
+ - id: Unique identifier for the tool
10
+ - remote-name: Name used by the MCP server (defaults to id)
11
+ - url: MCP server endpoint URL
12
+
13
+ Configurations are stored in the 'mcp' configuration group and can be
14
+ referenced by agent tools using the 'mcp-tool' type.
8
15
  """
9
16
 
10
17
  import argparse
@@ -17,7 +24,8 @@ default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
17
24
 
18
25
  def set_mcp_tool(
19
26
  url : str,
20
- name : str,
27
+ id : str,
28
+ remote_name : str,
21
29
  tool_url : str,
22
30
  ):
23
31
 
@@ -26,15 +34,13 @@ def set_mcp_tool(
26
34
  # Store the MCP tool configuration in the 'mcp' group
27
35
  values = api.put([
28
36
  ConfigValue(
29
- type="mcp", key=name, value=json.dumps({
30
- "name": name,
37
+ type="mcp", key=id, value=json.dumps({
38
+ "remote-name": remote_name,
31
39
  "url": tool_url,
32
40
  })
33
41
  )
34
42
  ])
35
43
 
36
- print(f"MCP tool '{name}' set with URL: {tool_url}")
37
-
38
44
  def main():
39
45
 
40
46
  parser = argparse.ArgumentParser(
@@ -45,8 +51,8 @@ def main():
45
51
  to the MCP server endpoint that provides the tool functionality.
46
52
 
47
53
  Examples:
48
- %(prog)s --name weather --tool-url "http://localhost:3000/weather"
49
- %(prog)s --name calculator --tool-url "http://mcp-tools.example.com/calc"
54
+ %(prog)s --id weather --tool-url "http://localhost:3000/weather"
55
+ %(prog)s --id calculator --tool-url "http://mcp-tools.example.com/calc"
50
56
  ''').strip(),
51
57
  formatter_class=argparse.RawDescriptionHelpFormatter
52
58
  )
@@ -58,9 +64,15 @@ def main():
58
64
  )
59
65
 
60
66
  parser.add_argument(
61
- '--name',
67
+ '-i', '--id',
62
68
  required=True,
63
- help='MCP tool name',
69
+ help='MCP tool identifier',
70
+ )
71
+
72
+ parser.add_argument(
73
+ '-r', '--remote-name',
74
+ required=False,
75
+ help='Remote MCP tool name (defaults to --id if not specified)',
64
76
  )
65
77
 
66
78
  parser.add_argument(
@@ -73,15 +85,21 @@ def main():
73
85
 
74
86
  try:
75
87
 
76
- if not args.name:
77
- raise RuntimeError("Must specify --name for MCP tool")
88
+ if not args.id:
89
+ raise RuntimeError("Must specify --id for MCP tool")
78
90
 
79
91
  if not args.tool_url:
80
- raise RuntimeError("Must specify --url for MCP tool")
92
+ raise RuntimeError("Must specify --tool-url for MCP tool")
93
+
94
+ if args.remote_name:
95
+ remote_name = args.remote_name
96
+ else:
97
+ remote_name = args.id
81
98
 
82
99
  set_mcp_tool(
83
- url=args.api_url,
84
- name=args.name,
100
+ url=args.api_url,
101
+ id=args.id,
102
+ remote_name=remote_name,
85
103
  tool_url=args.tool_url
86
104
  )
87
105
 
@@ -2,9 +2,15 @@
2
2
 
3
3
  """
4
4
  Configures and registers tools in the TrustGraph system.
5
- Allows defining tool metadata including ID, name, description, type,
6
- and argument specifications. Tools are stored in the agent configuration
7
- and indexed for discovery and execution.
5
+
6
+ This script allows you to define agent tools with various types including:
7
+ - knowledge-query: Query knowledge bases
8
+ - text-completion: Text generation
9
+ - mcp-tool: Reference to MCP (Model Context Protocol) tools
10
+ - prompt: Prompt template execution
11
+
12
+ Tools are stored in the 'tool' configuration group and can include
13
+ argument specifications for parameterized execution.
8
14
  """
9
15
 
10
16
  from typing import List
@@ -51,6 +57,9 @@ def set_tool(
51
57
  name : str,
52
58
  description : str,
53
59
  type : str,
60
+ mcp_tool : str,
61
+ collection : str,
62
+ template : str,
54
63
  arguments : List[Argument],
55
64
  ):
56
65
 
@@ -60,14 +69,20 @@ def set_tool(
60
69
  ConfigKey(type="agent", key="tool-index")
61
70
  ])
62
71
 
63
- ix = json.loads(values[0].value)
64
-
65
72
  object = {
66
- "id": id,
67
73
  "name": name,
68
74
  "description": description,
69
75
  "type": type,
70
- "arguments": [
76
+ }
77
+
78
+ if mcp_tool: object["mcp-tool"] = mcp_tool
79
+
80
+ if collection: object["collection"] = collection
81
+
82
+ if template: object["template"] = template
83
+
84
+ if arguments:
85
+ object["arguments"] = [
71
86
  {
72
87
  "name": a.name,
73
88
  "type": a.type,
@@ -75,17 +90,10 @@ def set_tool(
75
90
  }
76
91
  for a in arguments
77
92
  ]
78
- }
79
-
80
- if id not in ix:
81
- ix.append(id)
82
93
 
83
94
  values = api.put([
84
95
  ConfigValue(
85
- type="agent", key="tool-index", value=json.dumps(ix)
86
- ),
87
- ConfigValue(
88
- type="agent", key=f"tool.{id}", value=json.dumps(object)
96
+ type="tool", key=f"{id}", value=json.dumps(object)
89
97
  )
90
98
  ])
91
99
 
@@ -100,7 +108,8 @@ def main():
100
108
  Valid tool types:
101
109
  knowledge-query - Query knowledge bases
102
110
  text-completion - Text completion/generation
103
- mcp-tool - Model Control Protocol tool
111
+ mcp-tool - Model Control Protocol tool
112
+ prompt - Prompt template query
104
113
 
105
114
  Valid argument types:
106
115
  string - String/text parameter
@@ -128,28 +137,43 @@ def main():
128
137
 
129
138
  parser.add_argument(
130
139
  '--id',
131
- help=f'Tool ID',
140
+ help=f'Unique tool identifier',
132
141
  )
133
142
 
134
143
  parser.add_argument(
135
144
  '--name',
136
- help=f'Tool name',
145
+ help=f'Human-readable tool name',
137
146
  )
138
147
 
139
148
  parser.add_argument(
140
149
  '--description',
141
- help=f'Tool description',
150
+ help=f'Detailed description of what the tool does',
142
151
  )
143
152
 
144
153
  parser.add_argument(
145
154
  '--type',
146
- help=f'Tool type, one of: knowledge-query, text-completion, mcp-tool',
155
+ help=f'Tool type, one of: knowledge-query, text-completion, mcp-tool, prompt',
147
156
  )
148
157
 
149
158
  parser.add_argument(
150
- '--argument',
151
- nargs="*",
152
- help=f'Arguments, form: name:type:description',
159
+ '--mcp-tool',
160
+ help=f'For MCP type: ID of MCP tool configuration (as defined by tg-set-mcp-tool)',
161
+ )
162
+
163
+ parser.add_argument(
164
+ '--collection',
165
+ help=f'For knowledge-query type: collection to query',
166
+ )
167
+
168
+ parser.add_argument(
169
+ '--template',
170
+ help=f'For prompt type: template ID to use',
171
+ )
172
+
173
+ parser.add_argument(
174
+ '--argument',
175
+ nargs="*",
176
+ help=f'Tool arguments in the form: name:type:description (can specify multiple)',
153
177
  )
154
178
 
155
179
  args = parser.parse_args()
@@ -157,14 +181,14 @@ def main():
157
181
  try:
158
182
 
159
183
  valid_types = [
160
- "knowledge-query", "text-completion", "mcp-tool"
184
+ "knowledge-query", "text-completion", "mcp-tool", "prompt"
161
185
  ]
162
186
 
163
187
  if args.id is None:
164
- raise RuntimeError("Must specify --id for prompt")
188
+ raise RuntimeError("Must specify --id for tool")
165
189
 
166
190
  if args.name is None:
167
- raise RuntimeError("Must specify --name for prompt")
191
+ raise RuntimeError("Must specify --name for tool")
168
192
 
169
193
  if args.type:
170
194
  if args.type not in valid_types:
@@ -172,6 +196,8 @@ def main():
172
196
  "Type must be one of: " + ", ".join(valid_types)
173
197
  )
174
198
 
199
+ mcp_tool = args.mcp_tool
200
+
175
201
  if args.argument:
176
202
  arguments = [
177
203
  Argument.parse(a)
@@ -181,10 +207,15 @@ def main():
181
207
  arguments = []
182
208
 
183
209
  set_tool(
184
- url=args.api_url, id=args.id, name=args.name,
210
+ url=args.api_url,
211
+ id=args.id,
212
+ name=args.name,
185
213
  description=args.description,
186
214
  type=args.type,
187
- arguments=arguments
215
+ mcp_tool=mcp_tool,
216
+ collection=args.collection,
217
+ template=args.template,
218
+ arguments=arguments,
188
219
  )
189
220
 
190
221
  except Exception as e:
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
3
  """
4
- Dumps out the current agent tool configuration
4
+ Displays the current MCP (Model Context Protocol) tool configuration
5
5
  """
6
6
 
7
7
  import argparse
@@ -26,11 +26,10 @@ def show_config(url):
26
26
  table = []
27
27
 
28
28
  table.append(("id", value.key))
29
- table.append(("name", data["name"]))
29
+ table.append(("remote-name", data["remote-name"]))
30
30
  table.append(("url", data["url"]))
31
31
 
32
32
  print()
33
- print(value.key + ":")
34
33
 
35
34
  print(tabulate.tabulate(
36
35
  table,
@@ -1,7 +1,13 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
3
  """
4
- Dumps out the current agent tool configuration
4
+ Displays the current agent tool configurations
5
+
6
+ Shows all configured tools including their types:
7
+ - knowledge-query: Tools that query knowledge bases
8
+ - text-completion: Tools for text generation
9
+ - mcp-tool: References to MCP (Model Context Protocol) tools
10
+ - prompt: Tools that execute prompt templates
5
11
  """
6
12
 
7
13
  import argparse
@@ -17,37 +23,37 @@ def show_config(url):
17
23
 
18
24
  api = Api(url).config()
19
25
 
20
- values = api.get([
21
- ConfigKey(type="agent", key="tool-index")
22
- ])
23
-
24
- ix = json.loads(values[0].value)
26
+ values = api.get_values(type="tool")
25
27
 
26
- values = api.get([
27
- ConfigKey(type="agent", key=f"tool.{v}")
28
- for v in ix
29
- ])
28
+ for item in values:
30
29
 
31
- for n, key in enumerate(ix):
30
+ id = item.key
31
+ data = json.loads(item.value)
32
32
 
33
- data = json.loads(values[n].value)
33
+ tp = data["type"]
34
34
 
35
35
  table = []
36
36
 
37
- table.append(("id", data["id"]))
37
+ table.append(("id", id))
38
38
  table.append(("name", data["name"]))
39
39
  table.append(("description", data["description"]))
40
- table.append(("type", data["type"]))
41
-
42
- for n, arg in enumerate(data["arguments"]):
43
- table.append((
44
- f"arg {n}",
45
- f"{arg['name']}: {arg['type']}\n{arg['description']}"
46
- ))
47
-
40
+ table.append(("type", tp))
41
+
42
+ if tp == "mcp-tool":
43
+ table.append(("mcp-tool", data["mcp-tool"]))
44
+
45
+ if tp == "knowledge-query":
46
+ table.append(("collection", data["collection"]))
47
+
48
+ if tp == "prompt":
49
+ table.append(("template", data["template"]))
50
+ for n, arg in enumerate(data["arguments"]):
51
+ table.append((
52
+ f"arg {n}",
53
+ f"{arg['name']}: {arg['type']}\n{arg['description']}"
54
+ ))
48
55
 
49
56
  print()
50
- print(key + ":")
51
57
 
52
58
  print(tabulate.tabulate(
53
59
  table,
@@ -0,0 +1 @@
1
+ __version__ = "1.1.10"
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-cli
3
- Version: 1.1.9
3
+ Version: 1.1.10
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Home-page: https://github.com/trustgraph-ai/trustgraph
6
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v1.1.9.tar.gz
6
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v1.1.10.tar.gz
7
7
  Author: trustgraph.ai
8
8
  Author-email: security@trustgraph.ai
9
9
  Classifier: Programming Language :: Python :: 3
@@ -1 +0,0 @@
1
- __version__ = "1.1.9"
File without changes