chip

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CallToolRequestKey contextKey = "mcpRequest"
	ToolConfigKey      contextKey = "toolConfig"
)

Variables

View Source
var Version = "v1.0.0"

Functions

func CopyHeader

func CopyHeader(mcpRequest *mcp.CallToolRequest, httpRequest *http.Request, header string)

func GetCallToolRequest

func GetCallToolRequest(ctx context.Context) (*mcp.CallToolRequest, error)

func GetCollibraUrl

func GetCollibraUrl(ctx context.Context) (string, error)

func GetHeaderValue

func GetHeaderValue(mcpRequest *mcp.CallToolRequest, header string) string

func GetSessionId

func GetSessionId(mcpRequest *mcp.CallToolRequest) string

func NewMcpServer

func NewMcpServer() *mcp.Server

func RegisterMcpTool

func RegisterMcpTool[In, Out any](server *mcp.Server, tool *CollibraTool[In, Out], client *http.Client, toolConfig *ToolConfig)

Types

type CollibraClient

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

func NewCollibraClient

func NewCollibraClient(transport http.RoundTripper) *CollibraClient

func (*CollibraClient) RoundTrip

func (c *CollibraClient) RoundTrip(request *http.Request) (*http.Response, error)

type CollibraTool

type CollibraTool[In, Out any] struct {
	Tool        *mcp.Tool
	ToolHandler CollibraToolHandler[In, Out]
}

type CollibraToolHandler

type CollibraToolHandler[In, Out any] func(ctx context.Context, client *http.Client, input In) (Out, error)

type ToolConfig

type ToolConfig struct {
	CollibraUrl   string
	EnabledTools  []string
	DisabledTools []string
}

func GetToolConfig

func GetToolConfig(ctx context.Context) (*ToolConfig, error)

func (*ToolConfig) IsToolEnabled

func (tc *ToolConfig) IsToolEnabled(toolName string) bool

Jump to

Keyboard shortcuts

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