Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

build-a-tool-using-agent changedagents-and-tools/tool-use/build-a-tool-using-agent

Recorded here
Lines+4added
Lines−4removed
From line 3,821 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits12to this page, all time

The whole hunk

from line 3821, old and new numbered
/
lines
from line 3821
38213821 {
38223822 if ($name === 'create_calendar_event') {
38233823 if (count($input['attendees'] ?? []) > 10) {
3824 throw new InvalidArgumentException('Too many attendees (max 10)');
3824 throw new \InvalidArgumentException('Too many attendees (max 10)');
38253825 }
38263826 
38273827 return json_encode([
from line 3836
38363836 ]);
38373837 }
38383838 
3839 throw new InvalidArgumentException("Unknown tool: {$name}");
3839 throw new \InvalidArgumentException("Unknown tool: {$name}");
38403840 }
38413841 
38423842 // Build a request that exceeds the tool's attendee limit so the error path runs.
from line 3865
38653865 'tool_use_id' => $block->id,
38663866 'content' => runTool($block->name, $block->input),
38673867 ];
3868 } catch (Exception $e) {
3868 } catch (\Exception $e) {
38693869 // Signal failure so Claude can retry or ask for clarification.
38703870 $toolResults[] = [
38713871 'type' => 'tool_result',
from line 4517
45174517 ],
45184518 run: function (array $input): string {
45194519 if (count($input['attendees'] ?? []) > 10) {
4520 throw new InvalidArgumentException('Too many attendees (max 10)');
4520 throw new \InvalidArgumentException('Too many attendees (max 10)');
45214521 }
45224522 
45234523 return json_encode([
Feedback