filter

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShouldInclude

func ShouldInclude(name string, included []string, excluded []string) bool

Filter a name given an include list (whitelist) and an exclude list (blacklist). Exclusion takes priority for duplicates. If the inclusion list is empty, all names that aren't explicitly excluded will be included.

Types

type Filter

type Filter struct {
	// If true, only read-only tools will be included by the filter
	ReadOnly                bool
	IncludedTools           []string
	ExcludedTools           []string
	IncludedToolCollections []string
	ExcludedToolCollections []string
}

Filter holds configuration for filtering which tools and tool collections to make available in the server

func NewFilter

func NewFilter(readOnly bool, includedTools, excludedTools, includedToolCollections, excludedToolCollections []string) *Filter

func PassthroughFilter

func PassthroughFilter() *Filter

func (*Filter) ShouldIncludeCollection

func (f *Filter) ShouldIncludeCollection(collectionName string) bool

func (*Filter) ShouldIncludeTool

func (f *Filter) ShouldIncludeTool(toolDef *types.ToolDefinition) bool

ShouldIncludeTool determines if a tool should be included based on the filter configuration. It checks the tool name against include/exclude lists and respects the read-only filter setting.

Jump to

Keyboard shortcuts

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