Skip to Content

Tools

Tools extend agent capabilities. Squadron provides built-in tools and supports custom tool definitions.

Built-in Tools

HTTP

Make HTTP requests:

tools = [ builtins.http.get, builtins.http.post, builtins.http.put, builtins.http.patch, builtins.http.delete ]

Utils

Utility tools:

tools = [builtins.utils.sleep]

Custom Tools

Custom tools wrap built-in or plugin tools with custom schemas and transformations.

Basic Example

tool "weather" { implements = builtins.http.get description = "Get weather for a city" inputs { field "city" { type = "string" description = "City name" required = true } } url = "https://wttr.in/${inputs.city}?format=3" }

Attributes

AttributeTypeDescription
implementsreferenceThe underlying tool to wrap (e.g., builtins.http.get)
descriptionstringDescription shown to the agent
inputsblockInput schema definition

Input Fields

Input fields are defined using field blocks inside the inputs block:

inputs { field "field_name" { type = "string" # string, number, integer, boolean, array, object description = "Field description" required = true # or false } }

Shorthand Schema Syntax

For concise definitions, use the shorthand inputs = { ... } attribute form with schema helper functions. Both forms are fully equivalent.

tool "weather" { implements = builtins.http.get description = "Get weather for a city" inputs = { city = string("City name", true) units = string("Temperature units", { default = "metric" }) } url = "https://wttr.in/${inputs.city}?format=3" }

See Functions for the complete reference on string, number, integer, bool, list, map, object, and type references like any and any_primitive.

Field Expressions

Use inputs.field_name to reference input values in dynamic fields:

tool "create_todo" { implements = builtins.http.post description = "Create a new todo item" inputs { field "title" { type = "string" description = "The title of the todo" required = true } field "priority" { type = "string" description = "Priority level (low, medium, high)" required = false } } url = "https://jsonplaceholder.typicode.com/todos" body = { title = inputs.title completed = false userId = 1 } }

Wrapping Plugin Tools

Custom tools can wrap external plugin tools:

tool "shout" { implements = plugins.pinger.echo description = "Echo a message in ALL CAPS" inputs { field "text" { type = "string" description = "The text to shout" required = true } } message = inputs.text all_caps = true }

Referencing Custom Tools

agent "assistant" { tools = [ tools.weather, tools.create_todo ] }

Plugin Tools

External plugins can provide additional tools:

plugin "slack" { source = ".squadron/plugins/slack" version = "local" } agent "notifier" { tools = [plugins.slack.send_message] }

See Plugins for more information.

Last updated on