build-a-tool-using-agent changedagents-and-tools/tool-use/build-a-tool-using-agent
Nearest release: v2.1.281, published an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+34added
Lines−34removed
From line
1,070
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits4to this page, all time
The whole hunk
from line 1070, old and new numbered
/
from line 1070
10701070 }
10711071
10721072 # Keep the full conversation history in a JSON array so each turn sees prior context.
1073 MESSAGES='[{"role": "user", "content": "Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected]."}]'
1073 MESSAGES='[{"role": "user", "content": "Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected]."}]'
10741074
10751075 call_api() {
10761076 curl -s https://api.anthropic.com/v1/messages \
from line 1127
11271127
11281128 # Keep the full conversation history in a JSON array so each turn sees
11291129 # prior context.
1130 MESSAGES='[{"role": "user", "content": "Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected]."}]'
1130 MESSAGES='[{"role": "user", "content": "Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected]."}]'
11311131
11321132 call_api() {
11331133 # ant reads the request body as YAML on stdin: no auth headers, no
from line 1238
12381238 messages = [
12391239 {
12401240 "role": "user",
1241 "content": "Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected].",
1241 "content": "Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected].",
12421242 }
12431243 ]
12441244
from line 1329
13291329 {
13301330 role: "user",
13311331 content:
1332 "Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected].",
1332 "Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected].",
13331333 },
13341334 ];
13351335
from line 1442
14421442 new()
14431443 {
14441444 Role = Role.User,
1445 Content = "Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected].",
1445 Content = "Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected].",
14461446 },
14471447 ];
14481448
from line 1562
15621562 // Keep the full conversation history in a slice so each turn sees prior context.
15631563 messages := []anthropic.MessageParam{
15641564 anthropic.NewUserMessage(anthropic.NewTextBlock(
1565 "Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected].",
1565 "Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected].",
15661566 )),
15671567 }
15681568
from line 1689
16891689 List<MessageParam> messages = new ArrayList<>();
16901690 messages.add(MessageParam.builder()
16911691 .role(MessageParam.Role.USER)
1692 .content("Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected].")
1692 .content("Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected].")
16931693 .build());
16941694
16951695 Message response = client.messages().create(MessageCreateParams.builder()
from line 1791
17911791 $messages = [
17921792 [
17931793 'role' => 'user',
1794 'content' => 'Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected].',
1794 'content' => 'Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected].',
17951795 ],
17961796 ];
17971797
from line 1893
18931893 messages = [
18941894 {
18951895 role: "user",
1896 content: "Schedule a weekly team standup every Monday at 9am for the next 4 weeks. Invite the whole team: [email protected], [email protected], [email protected]."
1896 content: "Schedule a weekly team standup every Monday at 9am for the next 4 weeks, starting Monday, March 30, 2026. Invite the whole team: [email protected], [email protected], [email protected]."
18971897 }
18981898 ]
18991899
from line 2001
20012001 esac
20022002 }
20032003
2004 MESSAGES='[{"role": "user", "content": "Check what I have next Monday, then schedule a planning session that avoids any conflicts."}]'
2004 MESSAGES='[{"role": "user", "content": "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts."}]'
20052005
20062006 call_api() {
20072007 curl -s https://api.anthropic.com/v1/messages \
from line 2057
20572057 esac
20582058 }
20592059
2060 MESSAGES='[{"role": "user", "content": "Check what I have next Monday, then schedule a planning session that avoids any conflicts."}]'
2060 MESSAGES='[{"role": "user", "content": "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts."}]'
20612061
20622062 call_api() {
20632063 # ant reads the request body as YAML on stdin: no auth headers, no
from line 2187
21872187 messages = [
21882188 {
21892189 "role": "user",
2190 "content": "Check what I have next Monday, then schedule a planning session that avoids any conflicts.",
2190 "content": "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.",
21912191 }
21922192 ]
21932193
from line 2289
22892289 {
22902290 role: "user",
22912291 content:
2292 "Check what I have next Monday, then schedule a planning session that avoids any conflicts.",
2292 "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.",
22932293 },
22942294 ];
22952295
from line 2411
24112411 new()
24122412 {
24132413 Role = Role.User,
2414 Content = "Check what I have next Monday, then schedule a planning session that avoids any conflicts.",
2414 Content = "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.",
24152415 },
24162416 ];
24172417
from line 2532
25322532
25332533 messages := []anthropic.MessageParam{
25342534 anthropic.NewUserMessage(anthropic.NewTextBlock(
2535 "Check what I have next Monday, then schedule a planning session that avoids any conflicts.",
2535 "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.",
25362536 )),
25372537 }
25382538
from line 2662
26622662 List<MessageParam> messages = new ArrayList<>();
26632663 messages.add(MessageParam.builder()
26642664 .role(MessageParam.Role.USER)
2665 .content("Check what I have next Monday, then schedule a planning session that avoids any conflicts.")
2665 .content("Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.")
26662666 .build());
26672667
26682668 Message response = client.messages().create(MessageCreateParams.builder()
from line 2778
27782778 $messages = [
27792779 [
27802780 'role' => 'user',
2781 'content' => 'Check what I have next Monday, then schedule a planning session that avoids any conflicts.',
2781 'content' => 'Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.',
27822782 ],
27832783 ];
27842784
from line 2880
28802880 messages = [
28812881 {
28822882 role: "user",
2883 content: "Check what I have next Monday, then schedule a planning session that avoids any conflicts."
2883 content: "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts."
28842884 }
28852885 ]
28862886
from line 2987
29872987 }
29882988
29892989 EMAILS=$(seq 0 14 | sed 's/.*/user&@example.com/' | paste -sd, -)
2990 MESSAGES="[{\"role\": \"user\", \"content\": \"Schedule an all-hands with everyone: $EMAILS\"}]"
2990 MESSAGES="[{\"role\": \"user\", \"content\": \"Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: $EMAILS\"}]"
29912991
29922992 call_api() {
29932993 curl -s https://api.anthropic.com/v1/messages \
from line 3054
30543054 }
30553055
30563056 EMAILS=$(seq 0 14 | sed 's/.*/user&@example.com/' | paste -sd, -)
3057 MESSAGES=$(jq -n --arg msg "Schedule an all-hands with everyone: $EMAILS" \
3057 MESSAGES=$(jq -n --arg msg "Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: $EMAILS" \
30583058 '[{role: "user", content: $msg}]')
30593059
30603060 call_api() {
from line 3191
31913191 messages = [
31923192 {
31933193 "role": "user",
3194 "content": "Schedule an all-hands with everyone: " + ", ".join(f"user{i}@example.com" for i in range(15)),
3194 "content": "Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: " + ", ".join(f"user{i}@example.com" for i in range(15)),
31953195 }
31963196 ]
31973197
from line 3302
33023302 const messages: Anthropic.MessageParam[] = [
33033303 {
33043304 role: "user",
3305 content: `Schedule an all-hands with everyone: ${emails.join(", ")}`,
3305 content: `Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: ${emails.join(", ")}`,
33063306 },
33073307 ];
33083308
from line 3436
34363436
34373437 List<MessageParam> messages =
34383438 [
3439 new() { Role = Role.User, Content = $"Schedule an all-hands with everyone: {emails}" },
3439 new() { Role = Role.User, Content = $"Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: {emails}" },
34403440 ];
34413441
34423442 var response = await client.Messages.Create(new MessageCreateParams
from line 3574
35743574 }
35753575 messages := []anthropic.MessageParam{
35763576 anthropic.NewUserMessage(anthropic.NewTextBlock(
3577 "Schedule an all-hands with everyone: " + strings.Join(emails, ", "),
3577 "Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: " + strings.Join(emails, ", "),
35783578 )),
35793579 }
35803580
from line 3720
37203720 List<MessageParam> messages = new ArrayList<>();
37213721 messages.add(MessageParam.builder()
37223722 .role(MessageParam.Role.USER)
3723 .content("Schedule an all-hands with everyone: " + emails)
3723 .content("Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: " + emails)
37243724 .build());
37253725
37263726 Message response = client.messages().create(MessageCreateParams.builder()
from line 3844
38443844 $messages = [
38453845 [
38463846 'role' => 'user',
3847 'content' => 'Schedule an all-hands with everyone: ' . implode(', ', $emails),
3847 'content' => 'Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: ' . implode(', ', $emails),
38483848 ],
38493849 ];
38503850
from line 3958
39583958 messages = [
39593959 {
39603960 role: "user",
3961 content: "Schedule an all-hands with everyone: #{emails.join(", ")}"
3961 content: "Schedule a one-hour all-hands on Monday, March 30, 2026 at 10am with everyone: #{emails.join(", ")}"
39623962 }
39633963 ]
39643964
from line 4095
40954095 messages=[
40964096 {
40974097 "role": "user",
4098 "content": "Check what I have next Monday, then schedule a planning session that avoids any conflicts.",
4098 "content": "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.",
40994099 }
41004100 ],
41014101 ).until_done()
from line 4163
41634163 {
41644164 role: "user",
41654165 content:
4166 "Check what I have next Monday, then schedule a planning session that avoids any conflicts.",
4166 "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.",
41674167 },
41684168 ],
41694169 });
from line 4274
42744274 new()
42754275 {
42764276 Role = Role.User,
4277 Content = "Check what I have next Monday, then schedule a planning session that avoids any conflicts.",
4277 Content = "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.",
42784278 },
42794279 ],
42804280 },
from line 4378
43784378 MaxTokens: 1024,
43794379 Messages: []anthropic.BetaMessageParam{
43804380 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock(
4381 "Check what I have next Monday, then schedule a planning session that avoids any conflicts.",
4381 "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.",
43824382 )),
43834383 },
43844384 },
from line 4463
44634463 .model(Model.CLAUDE_OPUS_5_5)
44644464 .maxTokens(1024)
44654465 .addBeta("structured-outputs-2025-11-13")
4466 .addUserMessage("Check what I have next Monday, then schedule a planning session that avoids any conflicts.")
4466 .addUserMessage("Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.")
44674467 .addTool(CreateCalendarEvent.class)
44684468 .addTool(ListCalendarEvents.class)
44694469 .build());
from line 4556
45564556 messages: [
45574557 [
45584558 'role' => 'user',
4559 'content' => 'Check what I have next Monday, then schedule a planning session that avoids any conflicts.',
4559 'content' => 'Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts.',
45604560 ],
45614561 ],
45624562 model: Model::CLAUDE_OPUS_5_5,
from line 4631
46314631 messages: [
46324632 {
46334633 role: "user",
4634 content: "Check what I have next Monday, then schedule a planning session that avoids any conflicts."
4634 content: "Check what I have on Monday, March 30, 2026, then schedule a one-hour planning session that day that avoids any conflicts."
46354635 }
46364636 ]
46374637 )
No line in this hunk matches that.