Documentation
¶
Overview ¶
Package toolhive provides utilities for interacting with ToolHive
Index ¶
- func AddWarningComment(path, warning, detail string) error
- func BuildRunCommand(spec *types.RegistryEntry, tempName, image string) []string
- func ParseToolsJSON(output string) ([]string, error)
- func ParseToolsText(output string) ([]string, error)
- func UpdateSpecTools(path string, tools []string) error
- type Client
- func (c *Client) ListTools(serverName string) ([]string, error)
- func (c *Client) Logs(serverName string) (string, error)
- func (c *Client) RemoveServer(serverName string) error
- func (c *Client) RunServer(spec *types.RegistryEntry, serverName string) (string, error)
- func (c *Client) StopServer(serverName string) error
- type CommandBuilder
- func (b *CommandBuilder) AddBoolFlag(flag string, value bool) *CommandBuilder
- func (b *CommandBuilder) AddEnvVar(name, value string) *CommandBuilder
- func (b *CommandBuilder) AddFlag(flag, value string) *CommandBuilder
- func (b *CommandBuilder) AddPositional(value string) *CommandBuilder
- func (b *CommandBuilder) Build() []string
- type MCPListOutput
- type Tool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddWarningComment ¶
AddWarningComment adds a warning comment to a spec file
func BuildRunCommand ¶
func BuildRunCommand(spec *types.RegistryEntry, tempName, image string) []string
BuildRunCommand builds the thv run command arguments from a spec
func ParseToolsJSON ¶
ParseToolsJSON parses JSON output from thv mcp list tools --format json
func ParseToolsText ¶
ParseToolsText parses text output from thv mcp list (fallback parser)
func UpdateSpecTools ¶
UpdateSpecTools updates the tools field in a spec file
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a ToolHive client
func (*Client) RemoveServer ¶
RemoveServer removes a stopped MCP server
func (*Client) StopServer ¶
StopServer stops a running MCP server
type CommandBuilder ¶
type CommandBuilder struct {
// contains filtered or unexported fields
}
CommandBuilder helps build command line arguments for thv
func NewCommandBuilder ¶
func NewCommandBuilder(command string) *CommandBuilder
NewCommandBuilder creates a new command builder
func (*CommandBuilder) AddBoolFlag ¶
func (b *CommandBuilder) AddBoolFlag(flag string, value bool) *CommandBuilder
AddBoolFlag adds a boolean flag
func (*CommandBuilder) AddEnvVar ¶
func (b *CommandBuilder) AddEnvVar(name, value string) *CommandBuilder
AddEnvVar adds an environment variable
func (*CommandBuilder) AddFlag ¶
func (b *CommandBuilder) AddFlag(flag, value string) *CommandBuilder
AddFlag adds a flag with a value
func (*CommandBuilder) AddPositional ¶
func (b *CommandBuilder) AddPositional(value string) *CommandBuilder
AddPositional adds a positional argument
func (*CommandBuilder) Build ¶
func (b *CommandBuilder) Build() []string
Build returns the built command arguments
type MCPListOutput ¶
type MCPListOutput struct {
Tools []Tool `json:"tools"`
}
MCPListOutput represents the JSON output from thv mcp list