agents
agents copied to clipboard
New Tools: HTTP pre-built tools
I'd like to propose two new beta tools that address common patterns I've seen when building voice agents.
~~1. SMS Tool - Many voice agents need to send text messages during calls (order confirmations, addresses, booking links, etc.). This tool provides a simple way to send SMS via Twilio, SignalWire, or Vonage. It can auto-detect the caller's phone number from the SIP session or use pre-configured recipients. The goal is to reduce boilerplate for this common use case while keeping it flexible enough for different workflows.~~ UPD: SMS tools moved to another branch to separate discussion
HTTP Tool - A lot of agents need to call external APIs - webhooks, CRMs, internal services, etc. Rather than writing custom functions for each HTTP call, this tool lets you declaratively configure requests with parameters, headers, timeouts, and response handling. The idea is to make simple API integrations faster to implement while still supporting customization when needed.
Both tools include error handling, provider auto-detection (SMS), and parameter validation. I've included tests and an example with the weather agent showing how they work together.
Open to feedback on the API design, naming, and what additional features might be useful!
- added url templating with :param placeholders, auto-validating that every path param is declared and stripping those fields from the body. if the param is part of the URL template it's substituted into the path, otherwise it stays in the payload.
- built a quick schema builder + arg sanitizer so only whitelisted, type-checked params go over the wire; bad inputs from LLM raise ToolError.
- switched to the shared utils http session and block interruptions for mutating requests
- split the code into a reusable run_http_request() helper plus the existing factory, so custom tools can hook before/after without rewriting http logic.
- http tool name is required, no default description
so now you can either pass a full json_schema dict for complete control, or a shorthand params list (HTTPToolParam) for common string/enum/int/bool cases - the factory turns both into the same schema before validation.