Tools
Tools are callable functions that agents can invoke. Each tool belongs to an adapter and defines parameters using JSON Schema.Tool Types
Bedrock supports two types of tools:| Type | Description | Use Case |
|---|---|---|
| Internal | Runs in-process via a handler function | Built-in functionality, database operations |
| External | Calls an HTTP webhook URL | Custom APIs, third-party integrations |
How Tool Calls Work
When an agent decides to use a tool:- LLM generates a tool call with arguments
- Bedrock validates arguments against the tool’s JSON Schema
- Tool executes:
- Internal: Calls the handler function directly
- External: POSTs to the webhook URL
- Result returns to the agent as text
Internal Tools
Internal tools run Python functions in the Bedrock backend. They’re used for built-in adapters like Contacts, SMS, Email, Projects, and others. Example internal tool definition:handler is a dotted path to a Python function: module.path.function_name
Handler Function Signature
Internal handlers receive:External Tools (Webhooks)
External tools make HTTP POST requests to your API when called by an agent. This is how you integrate custom functionality. When an agent calls an external tool, Bedrock POSTs to yoururl with:
- Headers:
X-Agent-Secret(your product’s tool call secret) andX-Agent-Identity(agent UUID) - Body: The tool definition, agent/product context, and the LLM-generated arguments
Custom Adapters Guide
For a full walkthrough of creating adapters, registering tools, handling
webhook requests, verifying secrets, and best practices — see the Custom
Adapters guide.
Tool Parameters (JSON Schema)
Tool parameters use JSON Schema. Common patterns:Required String Parameter
Optional Parameters with Defaults
Enum Values
Nested Objects
Automatic Reasoning
Bedrock automatically adds areasoning parameter to all tools:
Detail URL (Dynamic Descriptions)
Tools can have adetail_url that’s fetched at runtime to augment the description with dynamic content:
Listing Tools
View all tools for an adapter:Best Practices
Clear Descriptions
Write detailed descriptions - they’re included in the LLM prompt.
Verify Secrets
Always verify
X-Agent-Secret in webhook handlers.Return Useful Data
Return structured, actionable information the agent can use.
Handle Errors Gracefully
Return error messages the agent can understand and act on.