tg-invoke-mcp-tool

Invokes MCP (Model Context Protocol) tools through the TrustGraph API.

Synopsis

tg-invoke-mcp-tool -n TOOL_NAME [options]

Description

The tg-invoke-mcp-tool command executes MCP tools by name with optional JSON parameters. This is useful for testing MCP tool functionality, debugging configurations, and executing tools directly from the command line.

Options

Required Arguments

Option Description
-n, --name TOOL_NAME Name of the MCP tool to invoke (case-sensitive)

Optional Arguments

Option Default Description
-u, --url URL $TRUSTGRAPH_URL or http://localhost:8088/ TrustGraph API URL
-t, --token TOKEN $TRUSTGRAPH_TOKEN Authentication token
-f, --flow-id FLOW default Flow identifier for execution context
-P, --parameters JSON {} Tool parameters as JSON dictionary

Examples

Invoke Without Parameters

tg-invoke-mcp-tool -n weather

Invoke With Parameters

tg-invoke-mcp-tool -n weather -P '{"location": "New York", "units": "celsius"}'

Complex Parameters

tg-invoke-mcp-tool -n document-analyzer -P '{
  "document_id": "doc123",
  "analysis_type": "sentiment",
  "options": {
    "include_entities": true,
    "confidence_threshold": 0.8
  }
}'

Custom Flow Context

tg-invoke-mcp-tool -f my-analysis-flow -n data-processor \
  -P '{"dataset": "sales_data", "operation": "summarize"}'

Environment Variables

  • TRUSTGRAPH_URL: Default API URL
  • TRUSTGRAPH_TOKEN: Default authentication token

API Integration

This command uses the MCP Tool Invocation API to execute tools with the specified parameters.