Skip to content

jonwraymond/toolcompose

Repository files navigation

toolcompose

CI Go Reference Go Report Card

Toolset composition, filtering, and skill orchestration for the ApertureStack AI tool ecosystem.

Installation

go get github.com/jonwraymond/toolcompose@latest

Packages

Package Description
set Toolset composition, filtering, and protocol exposure
skill Declarative skill planning and execution

Quick Start

Toolset Composition

import (
    "github.com/jonwraymond/toolcompose/set"
    "github.com/jonwraymond/toolfoundation/adapter"
)

// Create toolset from registry with filters and policy
ts, err := set.NewBuilder("my-toolset").
    FromRegistry(registry).
    WithNamespace("github").
    WithFilter(set.TagsAll("read")).
    WithPolicy(set.DenyTags("dangerous")).
    Build()

// Export to protocol format
exposure := set.NewExposure(ts, adapter.NewMCPAdapter())
tools, err := exposure.Export()

Skill Execution

import "github.com/jonwraymond/toolcompose/skill"

// Define a skill
s := skill.Skill{
    Name: "create-issue",
    Steps: []skill.Step{
        {ID: "search", ToolID: "github:search", Inputs: map[string]any{"q": "bug"}},
        {ID: "create", ToolID: "github:create-issue", Inputs: map[string]any{"title": "Fix bug"}},
    },
}

// Plan and execute
planner := skill.NewPlanner()
plan, err := planner.Plan(s)
results, err := skill.Execute(ctx, plan, myRunner)

Features

  • Toolset Composition: Build filtered toolsets from registries or tool slices
  • Filter Chaining: Compose filters with AND semantics
  • Built-in Filters: Namespace, tags, scopes, and custom predicates
  • Policy System: Allow/deny lists with DenyByDefault or AllowByDefault
  • Protocol Exposure: Export to MCP, OpenAI, or Anthropic formats
  • Feature Warnings: Detect schema feature loss during conversion
  • Skill Planning: Validate and plan multi-step tool sequences
  • Guard System: Max steps, allowed tool IDs, and custom guards
  • Deterministic Execution: Reproducible results for testing
  • Thread-Safe: Toolsets are safe for concurrent reads

Thread Safety

Type Thread-Safe Notes
Toolset Yes Safe for concurrent reads
Builder No Use in single goroutine
Exposure Yes Safe after construction
Planner Yes Stateless, safe to share
Plan Yes Immutable after creation

Documentation

Examples

go run ./examples/basic
go run ./examples/filter
go run ./examples/skill

Related Packages

toolcompose is part of the ApertureStack ecosystem:

toolfoundation     Core types, adapters, model definitions
     │
     v
tooldiscovery      Search, indexing, semantic discovery
     │
     v
toolexec           Execution, runtime isolation, backends
     │
     v
toolcompose        Composition, filtering, skill orchestration (this package)

License

MIT License - see LICENSE

About

Tool composition, toolsets, and agent skills

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors