← Table of Contents · Page 145 of 868

THE TOOL REGISTRY

Part 2 of 10

WHAT THE REGISTRY STORES A good registry entry holds several pieces of information. The name is a short unique label, such as read_file. The description is a plain-language sentence or two explaining what the tool does and when to use it, written for the model to read. The input schema, and often the output schema, as you learned in Chapter 13. The required permissions, a note about what level of access the tool needs, such as read, write, or administrator. The handler, a reference to the actual code that runs when the tool is called. Production registries add more fields: a version number, a deprecation status, rate-limit settings, a timeout, a flag saying whether the tool is read-only or an action, and perhaps a cost estimate. Here is a sample entry as indented lines. [START OF PYTHON CODE] # A tool registry entry describing the read_file tool { # The tool's name, used to look it up and call it "name": "read_file", # A plain-language description the model reads to decide when to use this tool "description": "Reads the contents of a file given its path", # The permission level this tool requires "permission": "read", # The version number of this tool entry "version": "1.2.0", # A reference to the actual function that runs when this tool is called "handler": read_file_handler } [END OF PYTHON CODE]
Advertisement
Read Aloud:
0:00 / 0:00