Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Tool Use in Go — Let Claude Call Your Functions

Video #05 — Claude API in Go Series
Publish date: 2026-06-29
Type: Heavy
Est. duration: ~38 min

What we cover

  • Defining tools as Go structs with JSON Input Schemas
  • Sending tools to Claude alongside your messages
  • Handling tool_use stop reason and ToolUseBlock responses
  • Executing your own Go functions when Claude requests them
  • Feeding tool_result blocks back and completing the loop

Prerequisites

  • Go 1.23+
  • An Anthropic API key
  • Familiarity with episodes 01–04 (completions, system prompts, streaming, structured output)

Running the example

cd 05-tool-use
export ANTHROPIC_API_KEY=your_key_here
go run main.go

Project structure

.
├── README.md
├── go.mod
├── go.sum
└── main.go