Versions in this module Expand all Collapse all v0 v0.2.0 Jul 14, 2026 v0.1.0 Jun 22, 2026 Changes in this version + const ContentTypeBinary + const ContentTypeJSON + const ContentTypeMixed + const ContentTypeStream + const ContentTypeText + const PermissionRuleMatcherKey + const ResolvedToolMetadataKey + const ToolSurfaceProfileMonoRun + const ToolSurfaceProfileSkillAgent + const ToolSurfaceProfileSubagent + func AttachPermissionMatcherMetadata(metadata map[string]any, resolvedTool Tool, matcher func(string) bool) map[string]any + func BuildPermissionMatcher(ctx context.Context, resolvedTool Tool, input map[string]any) (func(string) bool, error) + func IsDeferred(tool Tool) bool + func IsValidToolName(name string) bool + func PermissionMatcherFromMetadata(metadata map[string]any) func(string) bool + func RequiresUserInteraction(t Tool) bool + func VisibleInSurfaceProfile(def ToolDefinition, profile string) bool + type BackfillInputFn func(ctx context.Context, input map[string]any) map[string]any + type Builder struct + func NewBuilder(name string) *Builder + func (b *Builder) Build() (Tool, error) + func (b *Builder) ConcurrencySafe() *Builder + func (b *Builder) Destructive() *Builder + func (b *Builder) NoPermission() *Builder + func (b *Builder) ReadOnly() *Builder + func (b *Builder) WithAliases(aliases ...string) *Builder + func (b *Builder) WithBackfillInput(fn BackfillInputFn) *Builder + func (b *Builder) WithCategory(category string) *Builder + func (b *Builder) WithConcurrencySafetyEvaluator(predicate ToolPredicateFn) *Builder + func (b *Builder) WithDescription(description string) *Builder + func (b *Builder) WithDisplayName(displayName string) *Builder + func (b *Builder) WithEnabled(fn func() bool) *Builder + func (b *Builder) WithFormatResult(fn FormatResultFn) *Builder + func (b *Builder) WithHandler(handler HandlerFn) *Builder + func (b *Builder) WithInputSchema(schema schema.JSONSchema) *Builder + func (b *Builder) WithInputValidator(validator ValidateInputFn) *Builder + func (b *Builder) WithJSONSchema(toolName string, jsonSchema schema.JSONSchema) *Builder + func (b *Builder) WithMaxResultSize(max int) *Builder + func (b *Builder) WithMetadata(key string, value any) *Builder + func (b *Builder) WithPermissionChecker(checker CheckPermissionsFn) *Builder + func (b *Builder) WithReadOnlyEvaluator(predicate ToolPredicateFn) *Builder + func (b *Builder) WithSchemaValidator(validator *schema.Validator) *Builder + type CallInput = contract.CallInput + type CallResult = contract.CallResult + func NewErrorResult(err error) CallResult + func NewJSONResult(data any) CallResult + func NewTextResult(content string) CallResult + type CheckPermissionsFn func(ctx context.Context, input map[string]any, toolCtx ToolUseContext) types.PermissionResult + type ContentType = contract.ContentType + type ContextModifier = contract.ContextModifier + type Definition = contract.Definition + type FormatResultFn func(data any) string + type HandlerFn func(ctx context.Context, input CallInput, toolCtx ToolUseContext) (CallResult, error) + type PermissionMatcherTool = contract.PermissionMatcherTool + type Registry struct + func NewRegistry() *Registry + func NewRegistryWithConfig(config *RegistryConfig) *Registry + func (r *Registry) BuildSurface(ctx *SurfaceContext) (*Surface, error) + func (r *Registry) Clear() + func (r *Registry) Clone() *Registry + func (r *Registry) Count() int + func (r *Registry) Get(name string) (Tool, bool) + func (r *Registry) GetToolNames() []string + func (r *Registry) GetToolsByAlias(alias string) []Tool + func (r *Registry) HasTool(name string) bool + func (r *Registry) List() []Tool + func (r *Registry) ListByCategory(category string) []Tool + func (r *Registry) ListCategories() []string + func (r *Registry) ListDeferred() []Tool + func (r *Registry) ListNonDeferred() []Tool + func (r *Registry) Merge(other *Registry) error + func (r *Registry) Register(tool Tool) error + func (r *Registry) RegisterBatch(tools []Tool) error + func (r *Registry) Resolve(name string) (Tool, bool) + func (r *Registry) Search(query string) []Tool + func (r *Registry) Unregister(name string) error + type RegistryConfig struct + AllowDuplicates bool + CaseSensitive bool + func DefaultRegistryConfig() *RegistryConfig + type RequiresUserInteractionTool = contract.RequiresUserInteractionTool + type ResultMetadata = contract.ResultMetadata + type Surface struct + Tools []ToolDefinition + type SurfaceBuildRequest struct + AllowedNames []string + BlockedNames []string + CategoryFilter string + IncludeDestructive bool + IncludeReadOnly bool + PermissionCheck types.CanUseToolFn + SurfaceProfile string + type SurfaceBuilder struct + func NewSurfaceBuilder(registry *Registry) *SurfaceBuilder + func (b *SurfaceBuilder) Build(ctx context.Context, req SurfaceBuildRequest) (*Surface, error) + func (b *SurfaceBuilder) BuildToolMap(ctx context.Context, req SurfaceBuildRequest) (map[string]Tool, error) + type SurfaceContext struct + CategoryFilter string + IncludeDestructive bool + IncludeReadOnly bool + PermissionCheck types.CanUseToolFn + SurfaceProfile string + type Tool = contract.Tool + func NewSimpleTool(name string, description string, ...) (Tool, error) + func ToolFromMetadata(metadata map[string]any) Tool + type ToolDefinition struct + Category string + Description string + InputSchema schema.JSONSchema + Metadata map[string]any + Name string + type ToolPredicateFn func(input map[string]any) bool + type ToolUseContext = contract.ToolUseContext + func NewToolUseContext(sessionID types.SessionID, turnID types.TurnID, toolUseID string, ...) ToolUseContext + type Toolset = contract.Toolset + type ValidateInputFn func(ctx context.Context, input map[string]any) (map[string]any, error)