tools

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CopilotTools = map[string]types.Tool{
	"python":  PythonREPLTool{},
	"trivy":   TrivyTool{},
	"kubectl": KubectlTool{},
}

CopilotTools is a map of tool names to tools.

Functions

func GetMCPTools added in v0.6.0

func GetMCPTools(configFile string, verbose bool) (map[string]types.Tool, map[string]client.MCPClient, error)

GetMCPTools returns the MCP tools.

func GetToolPrompt added in v0.6.0

func GetToolPrompt() string

GetToolPrompt returns the tool prompt.

func GoogleSearch

func GoogleSearch(query string) (string, error)

GoogleSearch returns the results of a Google search for the given query.

func InitTools added in v0.6.0

func InitTools(mcpConfigFile string, verbose bool) (map[string]client.MCPClient, error)

InitTools initializes the tools.

func Kubectl added in v0.5.1

func Kubectl(command string) (string, error)

Kubectl runs the given kubectl command and returns the output.

func PythonREPL

func PythonREPL(script string) (string, error)

PythonREPL runs the given Python script and returns the output.

func Trivy added in v0.5.1

func Trivy(image string) (string, error)

Trivy runs trivy against the image and returns the output

Types

type GoogleSearchTool added in v0.6.0

type GoogleSearchTool struct{}

GoogleSearchTool performs web searches using the Google Search API.

func (GoogleSearchTool) Description added in v0.6.0

func (g GoogleSearchTool) Description() string

Description returns the description of the tool.

func (GoogleSearchTool) InputSchema added in v0.6.0

func (g GoogleSearchTool) InputSchema() string

InputSchema returns the input schema for the tool.

func (GoogleSearchTool) ToolFunc added in v0.6.0

func (g GoogleSearchTool) ToolFunc(query string) (string, error)

ToolFunc performs a web search using the provided query and returns the result.

type KubectlTool added in v0.6.0

type KubectlTool struct{}

KubectlTool executes kubectl commands against a Kubernetes cluster.

func (KubectlTool) Description added in v0.6.0

func (k KubectlTool) Description() string

Description returns the description of the tool.

func (KubectlTool) InputSchema added in v0.6.0

func (k KubectlTool) InputSchema() string

InputSchema returns the input schema for the tool.

func (KubectlTool) ToolFunc added in v0.6.0

func (k KubectlTool) ToolFunc(command string) (string, error)

ToolFunc executes the provided kubectl command and returns the result.

type MCPConfig added in v0.6.0

type MCPConfig struct {
	MCPServers map[string]MCPServer `json:"mcpServers"`
}

MCPConfig is the configuration for the MCP server.

type MCPServer added in v0.6.0

type MCPServer struct {
	Type    string            `json:"type,omitempty"`
	Command string            `json:"command,omitempty"`
	URL     string            `json:"url,omitempty"`
	Args    []string          `json:"args,omitempty"`
	Env     map[string]string `json:"env,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
	Timeout int               `json:"timeout,omitempty"`
}

MCPServer is the configuration for a single MCP server.

type MCPTool added in v0.6.0

type MCPTool struct {
	// contains filtered or unexported fields
}

MCPTool is a tool that uses the MCP protocol.

func (MCPTool) Description added in v0.6.0

func (t MCPTool) Description() string

Description returns the description of the tool.

func (MCPTool) InputSchema added in v0.6.0

func (t MCPTool) InputSchema() string

InputSchema returns the input schema for the tool.

func (MCPTool) ToolFunc added in v0.6.0

func (t MCPTool) ToolFunc(input string) (string, error)

ToolFunc is the function that will be called to execute the tool.

type PythonREPLTool added in v0.6.0

type PythonREPLTool struct{}

PythonREPLTool executes Python code in a REPL environment.

func (PythonREPLTool) Description added in v0.6.0

func (p PythonREPLTool) Description() string

Description returns the description of the tool.

func (PythonREPLTool) InputSchema added in v0.6.0

func (p PythonREPLTool) InputSchema() string

InputSchema returns the input schema for the tool.

func (PythonREPLTool) ToolFunc added in v0.6.0

func (p PythonREPLTool) ToolFunc(script string) (string, error)

ToolFunc executes the provided Python code and returns the result.

type TrivyTool added in v0.6.0

type TrivyTool struct{}

TrivyTool scans container images for vulnerabilities using Trivy.

func (TrivyTool) Description added in v0.6.0

func (t TrivyTool) Description() string

Description returns the description of the tool.

func (TrivyTool) InputSchema added in v0.6.0

func (t TrivyTool) InputSchema() string

InputSchema returns the input schema for the tool.

func (TrivyTool) ToolFunc added in v0.6.0

func (t TrivyTool) ToolFunc(image string) (string, error)

ToolFunc scans the provided container image and returns the result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL