Thanks to visit codestin.com
Credit goes to pkg.go.dev

codermcp

package
v2.21.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ToolDeps

type ToolDeps struct {
	Client        *codersdk.Client
	AgentClient   *agentsdk.Client
	Logger        *slog.Logger
	AppStatusSlug string
}

ToolDeps contains all dependencies needed by tool handlers

type ToolHandler

type ToolHandler struct {
	Tool        mcp.Tool
	MakeHandler func(ToolDeps) server.ToolHandlerFunc
}

ToolHandler associates a tool with its handler creation function

type ToolRegistry

type ToolRegistry []ToolHandler

ToolRegistry is a map of available tools with their handler creation functions

func AllTools

func AllTools() ToolRegistry

AllTools returns all available tools.

func (ToolRegistry) Register

func (r ToolRegistry) Register(srv *server.MCPServer, deps ToolDeps)

Register registers all tools in the registry with the given tool adder and dependencies.

func (ToolRegistry) WithOnlyAllowed

func (r ToolRegistry) WithOnlyAllowed(allowed ...string) ToolRegistry

WithOnlyAllowed returns a new ToolRegistry containing only the tools specified in the allowed list.

Jump to

Keyboard shortcuts

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