Introducing Claude's External Tool Use

Source:

Anthropic
on
May 16, 2024
Curated on

May 27, 2024

Anthropic has announced the public beta of an exciting new feature for Claude's API: the ability to interact with external, client-side tools. This marks a significant step forward as it enables users to furnish Claude with a slew of custom utilities to expand its task-handling capabilities. Just by adding the designated 'anthropic-beta: tools-2024-05-16' header in API requests, users can unlock this feature, allowing Claude to stream data, enforce tool use, and even manage images. By providing an example using Claude's Messages API, the announcement clarifies the process for supplying tools - defining them with a name, description, and a structured input schema. For instance, a 'get_weather' tool would necessitate a location input to return the current weather information for that location. Additionally, there is a clear guide on best practices for tool descriptions, emphasizing detailed explanations for optimal functionality. Upon incorporating a client's custom tools, Claude evaluates a provided user prompt to decide if and which tools are relevant for the query. If a tool is needed, Claude formulates an appropriate tool use request. The client's side is then tasked with running the specified code and relaying the results back to Claude for a final response. It's worth noting that all tools used by Claude must be user-supplied, ensuring Claude doesn’t have access to built-in server-side tools, thereby allowing the user full control over the functions Claude can perform. Further elaborating on the tool integration structure, the release details the content blocks necessary for a tool use response, including tool result returns, which Claude then incorporates into its ultimate answer to the user prompt. This interactive model reaffirms the seamless cooperation between Claude and user-defined tools. Several best practices and recommendations have been listed for enhancing tool performance, such as providing highly detailed tool descriptions and prioritizing these over examples. The announcement suggests avoiding overcomplex nested objects in tool definitions and focusing on sequential rather than parallel tool use, which Claude handles more effectively. Attention to Claude’s troubleshooting advice and reflection on the chain of thought are also advised for better tool use understanding. Furthermore, the update includes notes on using JSON output for models to oblige a provided schema, such as summarizing records. Wrapping up the release, Anthropic discusses the intricacies of error handling, with various scenarios and solutions, highlighting the adaptiveness of Claude's API to various external tool interactions.

Ready to Transform Your Organization?

Take the first step toward harnessing the power of AI for your organization. Get in touch with our experts, and let's embark on a transformative journey together.

Contact Us today