05-custom-tools

command
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 6 Imported by: 0

README

05-custom-tools: Selective built-ins + custom tool

This example shows how to:

  • Enable only a subset of built-in tools via EnabledBuiltinTools
  • Append a custom EchoTool via CustomTools
  • Keep legacy Tools override semantics unchanged (not used here)

Run

export ANTHROPIC_API_KEY=sk-ant-...
go run ./examples/05-custom-tools

What happens

  • Registers built-ins bash and file_read (because EnabledBuiltinTools lists them)
  • Skips other built-ins (empty list would disable all)
  • Appends a custom echo tool
  • Sends a prompt instructing the model to call echo

Adjust the options in main.go to:

  • Enable all built-ins: set EnabledBuiltinTools: nil
  • Disable all built-ins: set EnabledBuiltinTools: []string{}
  • Add more custom tools: append to CustomTools

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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