3 Tools🔗ℹ

(make-tool name description parameters procedure) -> tool?

  name        : (or/c symbol? string?)

  description : string?

  parameters  : (listof parameter-spec?)

  procedure   : (-> (hash/c symbol? json+jsexpr?) any/c)

(parameter name type description

           #:required required? #:enum enumeration) -> parameter-spec?

A tool is an ordinary Racket procedure of one hash argument (symbol keys, decoded JSON). Non-string return values are formatted with ~a.

Execution never throws. run-tool-calls returns one tool-result per call, and every failure — unknown tool, missing required argument, a crashing procedure — becomes an "Error: ..." output string. Tool failures are the model’s feedback channel; one bad call must not abort an agent loop.