tools

package
v0.0.0-...-df7f11c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHandler

func CreateHandler(tool Tool) func(context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error)

func GenerateMetadata

func GenerateMetadata(tool Tool) mcp.Tool

Types

type ChalkApplyParams

type ChalkApplyParams struct {
	ProjectRepository string `` /* 146-byte string literal not displayed */
	BranchName        string `json:"branch_name" mcp:"description=Name of the branch to deploy to. If not provided, defaults to the current git branch."`
}

type ChalkApplyTool

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

func NewChalkApplyTool

func NewChalkApplyTool(executor CommandExecutor) *ChalkApplyTool

func (*ChalkApplyTool) Description

func (t *ChalkApplyTool) Description() string

func (*ChalkApplyTool) Execute

func (t *ChalkApplyTool) Execute(ctx context.Context, args any) (*mcp.CallToolResult, error)

func (*ChalkApplyTool) Name

func (t *ChalkApplyTool) Name() string

func (*ChalkApplyTool) ParamsType

func (t *ChalkApplyTool) ParamsType() reflect.Type

type ChalkConfigParams

type ChalkConfigParams struct {
	ProjectRepository string `` /* 146-byte string literal not displayed */
}

type ChalkConfigTool

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

func NewChalkConfigTool

func NewChalkConfigTool(executor CommandExecutor) *ChalkConfigTool

func (*ChalkConfigTool) Description

func (t *ChalkConfigTool) Description() string

func (*ChalkConfigTool) Execute

func (t *ChalkConfigTool) Execute(ctx context.Context, args any) (*mcp.CallToolResult, error)

func (*ChalkConfigTool) Name

func (t *ChalkConfigTool) Name() string

func (*ChalkConfigTool) ParamsType

func (t *ChalkConfigTool) ParamsType() reflect.Type

type ChalkEnvironmentOperation

type ChalkEnvironmentOperation string
const (
	ChalkEnvironmentOperationSet ChalkEnvironmentOperation = "set"
	ChalkEnvironmentOperationGet ChalkEnvironmentOperation = "get"
)

type ChalkEnvironmentParams

type ChalkEnvironmentParams struct {
	ProjectRepository string `` /* 146-byte string literal not displayed */
	Operation         string `json:"operation" mcp:"required,description=The operation to perform on the chalk environment"`
	Environment       string `` /* 144-byte string literal not displayed */
}

type ChalkEnvironmentTool

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

func NewChalkEnvironmentTool

func NewChalkEnvironmentTool(executor CommandExecutor) *ChalkEnvironmentTool

func (*ChalkEnvironmentTool) Description

func (t *ChalkEnvironmentTool) Description() string

func (*ChalkEnvironmentTool) Execute

func (t *ChalkEnvironmentTool) Execute(ctx context.Context, args any) (*mcp.CallToolResult, error)

func (*ChalkEnvironmentTool) Name

func (t *ChalkEnvironmentTool) Name() string

func (*ChalkEnvironmentTool) ParamsType

func (t *ChalkEnvironmentTool) ParamsType() reflect.Type

type ChalkFeaturesParams

type ChalkFeaturesParams struct {
	ProjectRepository string `` /* 168-byte string literal not displayed */
}

type ChalkFeaturesTool

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

func NewChalkFeaturesTool

func NewChalkFeaturesTool(executor CommandExecutor) *ChalkFeaturesTool

func (*ChalkFeaturesTool) Description

func (t *ChalkFeaturesTool) Description() string

func (*ChalkFeaturesTool) Execute

func (t *ChalkFeaturesTool) Execute(ctx context.Context, args any) (*mcp.CallToolResult, error)

func (*ChalkFeaturesTool) Name

func (t *ChalkFeaturesTool) Name() string

func (*ChalkFeaturesTool) ParamsType

func (t *ChalkFeaturesTool) ParamsType() reflect.Type

type ChalkLintParams

type ChalkLintParams struct {
	ProjectRepository string `` /* 154-byte string literal not displayed */
}

type ChalkLintTool

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

func NewChalkLintTool

func NewChalkLintTool(executor CommandExecutor) *ChalkLintTool

func (*ChalkLintTool) Description

func (t *ChalkLintTool) Description() string

func (*ChalkLintTool) Execute

func (t *ChalkLintTool) Execute(ctx context.Context, args any) (*mcp.CallToolResult, error)

func (*ChalkLintTool) Name

func (t *ChalkLintTool) Name() string

func (*ChalkLintTool) ParamsType

func (t *ChalkLintTool) ParamsType() reflect.Type

type ChalkLogsParams

type ChalkLogsParams struct {
	Query             string `` /* 156-byte string literal not displayed */
	ProjectRepository string `` /* 146-byte string literal not displayed */
}

type ChalkLogsTool

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

func NewChalkLogsTool

func NewChalkLogsTool(executor CommandExecutor) *ChalkLogsTool

func (*ChalkLogsTool) Description

func (t *ChalkLogsTool) Description() string

func (*ChalkLogsTool) Execute

func (t *ChalkLogsTool) Execute(ctx context.Context, args any) (*mcp.CallToolResult, error)

func (*ChalkLogsTool) Name

func (t *ChalkLogsTool) Name() string

func (*ChalkLogsTool) ParamsType

func (t *ChalkLogsTool) ParamsType() reflect.Type

type ChalkQueryParams

type ChalkQueryParams struct {
	ProjectRepository string            `` /* 146-byte string literal not displayed */
	InputFeatures     map[string]string `` /* 162-byte string literal not displayed */
	OutputFeatures    []string          `` /* 127-byte string literal not displayed */
	BranchName        string            `json:"branch_name" mcp:"description=Name of the branch to query against. If not provided, uses the mainline deployment."`
}

type ChalkQueryTool

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

func NewChalkQueryTool

func NewChalkQueryTool(executor CommandExecutor) *ChalkQueryTool

func (*ChalkQueryTool) Description

func (t *ChalkQueryTool) Description() string

func (*ChalkQueryTool) Execute

func (t *ChalkQueryTool) Execute(ctx context.Context, args any) (*mcp.CallToolResult, error)

func (*ChalkQueryTool) Name

func (t *ChalkQueryTool) Name() string

func (*ChalkQueryTool) ParamsType

func (t *ChalkQueryTool) ParamsType() reflect.Type

type CommandExecutor

type CommandExecutor interface {
	Execute(ctx context.Context, workDir string, args ...string) ([]byte, error)
}

type DefaultCommandExecutor

type DefaultCommandExecutor struct{}

DefaultCommandExecutor calls chalk command with the given args

func (*DefaultCommandExecutor) Execute

func (e *DefaultCommandExecutor) Execute(ctx context.Context, workDir string, args ...string) ([]byte, error)

type MockCommandExecutor

type MockCommandExecutor struct {
	mock.Mock
}

MockCommandExecutor for testing

func (*MockCommandExecutor) Execute

func (m *MockCommandExecutor) Execute(ctx context.Context, workDir string, args ...string) ([]byte, error)

type Tool

type Tool interface {
	// Name returns the tool name
	Name() string

	// Description returns the tool description
	Description() string

	// Execute runs the tool with parsed arguments
	Execute(ctx context.Context, args any) (*mcp.CallToolResult, error)

	// ParamsType returns the type of the params struct
	ParamsType() reflect.Type
}

Jump to

Keyboard shortcuts

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