mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
Feature/react call mcp (#428)
Key Features - MCP Tool Integration: Added core MCP tool support with ToolClientSpec and ToolClient classes - API Enhancement: New mcp_tool method for flow-specific tool invocation - CLI Tooling: New tg-invoke-mcp-tool command for testing MCP integration - React Agent Enhancement: Fixed and improved multi-tool invocation capabilities - Tool Management: Enhanced CLI for tool configuration and management Changes - Added MCP tool invocation to API with flow-specific integration - Implemented ToolClientSpec and ToolClient for tool call handling - Updated agent-manager-react to invoke MCP tools with configurable types - Enhanced CLI with new commands and improved help text - Added comprehensive documentation for new CLI commands - Improved tool configuration management Testing - Added tg-invoke-mcp-tool CLI command for isolated MCP integration testing - Enhanced agent capability to invoke multiple tools simultaneously
This commit is contained in:
parent
e56186054a
commit
9c7a070681
22 changed files with 2718 additions and 9 deletions
|
|
@ -210,6 +210,51 @@ Request schema:
|
|||
Response schema:
|
||||
`trustgraph.schema.FlowResponse`
|
||||
|
||||
## Flow Service Methods
|
||||
|
||||
Flow instances provide access to various TrustGraph services through flow-specific endpoints:
|
||||
|
||||
### MCP Tool Service - Invoke MCP Tools
|
||||
|
||||
The `mcp_tool` method allows invoking MCP (Model Control Protocol) tools within a flow context.
|
||||
|
||||
Request:
|
||||
```json
|
||||
{
|
||||
"name": "file-reader",
|
||||
"parameters": {
|
||||
"path": "/path/to/file.txt"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"object": {"content": "file contents here", "size": 1024}
|
||||
}
|
||||
```
|
||||
|
||||
Or for text responses:
|
||||
```json
|
||||
{
|
||||
"text": "plain text response"
|
||||
}
|
||||
```
|
||||
|
||||
### Other Service Methods
|
||||
|
||||
Flow instances also provide access to:
|
||||
- `text_completion` - LLM text completion
|
||||
- `agent` - Agent question answering
|
||||
- `graph_rag` - Graph-based RAG queries
|
||||
- `document_rag` - Document-based RAG queries
|
||||
- `embeddings` - Text embeddings
|
||||
- `prompt` - Prompt template processing
|
||||
- `triples_query` - Knowledge graph queries
|
||||
- `load_document` - Document loading
|
||||
- `load_text` - Text loading
|
||||
|
||||
## Python SDK
|
||||
|
||||
The Python SDK provides convenient access to the Flow API:
|
||||
|
|
@ -233,6 +278,10 @@ flows = await client.list_flows()
|
|||
|
||||
# Stop a flow instance
|
||||
await client.stop_flow("flow-123")
|
||||
|
||||
# Use flow instance services
|
||||
flow = client.id("flow-123")
|
||||
result = await flow.mcp_tool("file-reader", {"path": "/path/to/file.txt"})
|
||||
```
|
||||
|
||||
## Features
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue