MCPcopy Create free account
hub / github.com/astercloud/aster / Tool

Interface Tool

pkg/tools/interface.go:45–60  ·  view source on GitHub ↗

Tool 工具接口

Source from the content-addressed store, hash-verified

43
44// Tool 工具接口
45type Tool interface {
46 // Name 工具名称
47 Name() string
48
49 // Description 工具描述
50 Description() string
51
52 // InputSchema JSON Schema定义
53 InputSchema() map[string]any
54
55 // Execute 执行工具
56 Execute(ctx context.Context, input map[string]any, tc *ToolContext) (any, error)
57
58 // Prompt 工具使用说明(可选)
59 Prompt() string
60}
61
62// AnnotatedTool 带安全注解的工具接口
63// 实现此接口的工具可以提供安全注解,帮助权限系统做出智能决策

Callers 32

SelectToolsMethod · 0.65
cleanupFilesMethod · 0.65
NameMethod · 0.65
ExecuteMethod · 0.65
GetToolSchemaMethod · 0.65
ExecuteMethod · 0.65
ExecuteMethod · 0.65
mainFunction · 0.95
DescriptionMethod · 0.65
GetToolSchemaMethod · 0.65
IndexToolMethod · 0.65

Implementers 15

CachedToolpkg/tools/cache.go
BaseToolpkg/tools/enhanced_types.go
mockToolWithAnnotationspkg/tools/annotations_test.go
mockToolWithoutAnnotationspkg/tools/annotations_test.go
mockToolpkg/tools/constraints_test.go
MockToolpkg/tools/cache_test.go
mockToolpkg/tools/bridge/bridge_test.go
MockToolpkg/tools/bridge/ptc_integration_test.
addToolpkg/tools/knowledge/factory.go
searchToolpkg/tools/knowledge/factory.go
MCPToolAdapterpkg/tools/mcp/adapter.go
CodeExecuteToolpkg/tools/builtin/codeexecute.go

Calls

no outgoing calls

Tested by

no test coverage detected