Overview
Tool Name:ago_http_request
This tool provides agents with the ability to call external REST APIs, enabling real-time data retrieval, integrations with external services, and custom workflow automation.
Key Features
- Support for HTTP methods (GET, POST, PUT, DELETE)
- Custom headers and authentication
- JSON request/response handling
- SSRF protection (blocks internal IP ranges)
Security
SSRF Protection
The tool includes built-in Server-Side Request Forgery (SSRF) protection: Blocked IP Ranges:- Private networks:
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 - Localhost:
127.0.0.0/8 - Link-local:
169.254.0.0/16 - Internal hostnames
Warning: Attempts to access internal networks will be blocked and logged.
Authentication Security
- API keys stored encrypted in
secret_keyfield - Credentials never exposed to users
- Support for bearer tokens, API keys, basic auth
Configuration
Create HTTP Tool
To create an HTTP request tool:- Navigate to AI Studio → Tools
- Click Create Tool
- Select HTTP Request as the tool type
- Configure the basic settings:
- Name: Internal identifier (e.g., “weather_api”)
- Display Name: User-facing name (e.g., “Get Weather”)
- Description: What this tool does
- Prompt: When the agent should use this tool
- Configure the HTTP settings:
- Base URL: The API endpoint (e.g.,
https://api.weather.example.com) - Method: GET, POST, PUT, or DELETE
- Headers: Any required headers
- Secret Key: API key or token (stored securely)
- Base URL: The API endpoint (e.g.,
- Define the Input Schema with parameters the agent can pass
- Click Save
- Assign the tool to your agent
Configuration Fields
Authentication Options
Put your credential in the Secret Key field and reference it from a header value with the{{secret_key}} placeholder. At request time, every {{secret_key}} in your headers is replaced with the stored secret. This keeps the credential out of the Headers JSON, which is not encrypted.
The Secret Key field is stored encrypted and is never exposed to users or in logs. The
{{secret_key}} placeholder is replaced in header values only — put it directly in a header, not in the URL or request body.Input Schema
Define parameters that agents can pass to the API. Common parameters include:
Add custom parameters based on what your API requires (e.g.,
customer_id, search_query, filter_status).
Parameter Types
Request Building
URL Construction
The request is sent to the configuredbase_url, with any params added as query parameters:
- base_url:
https://api.example.com/users - params:
{"include": "profile", "limit": "10"} - Result:
https://api.example.com/users?include=profile&limit=10
Request Body
For POST/PUT requests:- Set the Method to POST or PUT
- Add the
Content-Type: application/jsonheader - Define input schema parameters that will be sent in the request body
user_email(str): User’s email addressmessage(str): Message content
Response Handling
Successful Response
The tool returns the API response to the agent:Error Response
Examples
Example 1: GET Request - Fetch Customer Data
Example 2: POST Request - Create Sales Lead
Best Practices
Tool Design
- Single purpose: One tool per API operation
- Clear naming: Describe what the tool does
- Minimal inputs: Only request necessary parameters
- Default values: Provide sensible defaults
Security
- Never expose credentials: Use
secret_keyfield - Limit permissions: Use least-privilege API keys
- Validate inputs: Define strict input schemas
- Log usage: Monitor tool call patterns
Performance
- Handle errors: Provide fallback behavior
- Cache responses: For frequently accessed data
- Rate limit: Respect API limits
Troubleshooting
Issue: Request blocked by SSRF protection
Issue: Request blocked by SSRF protection
Problem: Tool returns “Request blocked” error.Solutions:
- Verify URL is a public internet address
- Check for redirects to internal IPs
- Use public DNS names, not IP addresses
Issue: Authentication failures
Issue: Authentication failures
Problem: API returns 401 or 403 errors.Solutions:
- Verify
secret_keyis correct - Check header format (Bearer vs API key)
- Confirm API key has necessary permissions
- Check for key expiration
Issue: Invalid response parsing
Issue: Invalid response parsing
Problem: Agent can’t interpret API response.Solutions:
- Verify API returns expected JSON format
- Check for API version changes
- Review tool description to help the agent interpret the response
API Reference
See Public API v1 Reference for programmatic tool management.Related Documentation
- Tools Description Guide - Best practices for tool descriptions
- Tools Overview - Tool configuration
- Agents - Agent configuration
