Updated tool cmd line

This commit is contained in:
Cyber MacGeddon 2025-09-05 12:16:40 +01:00
parent 50c37407c5
commit 01bb756fae
2 changed files with 23 additions and 12 deletions

View file

@ -3,6 +3,7 @@ Configures and registers tools in the TrustGraph system.
This script allows you to define agent tools with various types including: This script allows you to define agent tools with various types including:
- knowledge-query: Query knowledge bases - knowledge-query: Query knowledge bases
- structured-query: Query structured data using natural language
- text-completion: Text generation - text-completion: Text generation
- mcp-tool: Reference to MCP (Model Context Protocol) tools - mcp-tool: Reference to MCP (Model Context Protocol) tools
- prompt: Prompt template execution - prompt: Prompt template execution
@ -117,10 +118,14 @@ def main():
description=__doc__, description=__doc__,
epilog=textwrap.dedent(''' epilog=textwrap.dedent('''
Valid tool types: Valid tool types:
knowledge-query - Query knowledge bases knowledge-query - Query knowledge bases (fixed args)
text-completion - Text completion/generation structured-query - Query structured data using natural language (fixed args)
mcp-tool - Model Control Protocol tool text-completion - Text completion/generation (fixed args)
prompt - Prompt template query mcp-tool - Model Control Protocol tool (configurable args)
prompt - Prompt template query (configurable args)
Note: Tools marked "(fixed args)" have predefined arguments and don't need
--argument specified. Tools marked "(configurable args)" require --argument.
Valid argument types: Valid argument types:
string - String/text parameter string - String/text parameter
@ -130,8 +135,12 @@ def main():
%(prog)s --id weather_tool --name get_weather \\ %(prog)s --id weather_tool --name get_weather \\
--type knowledge-query \\ --type knowledge-query \\
--description "Get weather information for a location" \\ --description "Get weather information for a location" \\
--argument location:string:"Location to query" \\ --collection weather_data
--argument units:string:"Temperature units (C/F)"
%(prog)s --id data_query_tool --name query_data \\
--type structured-query \\
--description "Query structured data using natural language" \\
--collection sales_data
%(prog)s --id calc_tool --name calculate --type mcp-tool \\ %(prog)s --id calc_tool --name calculate --type mcp-tool \\
--description "Perform mathematical calculations" \\ --description "Perform mathematical calculations" \\
@ -164,7 +173,7 @@ def main():
parser.add_argument( parser.add_argument(
'--type', '--type',
help=f'Tool type, one of: knowledge-query, text-completion, mcp-tool, prompt', help=f'Tool type, one of: knowledge-query, structured-query, text-completion, mcp-tool, prompt',
) )
parser.add_argument( parser.add_argument(
@ -174,7 +183,7 @@ def main():
parser.add_argument( parser.add_argument(
'--collection', '--collection',
help=f'For knowledge-query type: collection to query', help=f'For knowledge-query and structured-query types: collection to query',
) )
parser.add_argument( parser.add_argument(
@ -210,7 +219,7 @@ def main():
try: try:
valid_types = [ valid_types = [
"knowledge-query", "text-completion", "mcp-tool", "prompt" "knowledge-query", "structured-query", "text-completion", "mcp-tool", "prompt"
] ]
if args.id is None: if args.id is None:

View file

@ -3,6 +3,7 @@ Displays the current agent tool configurations
Shows all configured tools including their types: Shows all configured tools including their types:
- knowledge-query: Tools that query knowledge bases - knowledge-query: Tools that query knowledge bases
- structured-query: Tools that query structured data using natural language
- text-completion: Tools for text generation - text-completion: Tools for text generation
- mcp-tool: References to MCP (Model Context Protocol) tools - mcp-tool: References to MCP (Model Context Protocol) tools
- prompt: Tools that execute prompt templates - prompt: Tools that execute prompt templates
@ -40,7 +41,8 @@ def show_config(url):
if tp == "mcp-tool": if tp == "mcp-tool":
table.append(("mcp-tool", data["mcp-tool"])) table.append(("mcp-tool", data["mcp-tool"]))
if tp == "knowledge-query": if tp == "knowledge-query" or tp == "structured-query":
if "collection" in data:
table.append(("collection", data["collection"])) table.append(("collection", data["collection"]))
if tp == "prompt": if tp == "prompt":