chip

package
v0.0.14 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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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