Canonical Definition
{
"function": {
"description": "Make a raw HTTP/REST API request (GET, POST, PUT, DELETE) to an external service. Use this to interact with webhooks, external APIs, or download raw JSON data.",
"name": "api_request",
"parameters": {
"properties": {
"body": {
"default": "",
"description": "JSON string of the request body (for POST/PUT).",
"type": "string"
},
"headers": {
"default": "{}",
"description": "JSON string of HTTP headers to include (e.g., '{\"Authorization\": \"Bearer token\"}').",
"type": "string"
},
"method": {
"description": "The HTTP method (e.g., 'GET', 'POST').",
"type": "string"
},
"url": {
"description": "The full URL of the API endpoint.",
"type": "string"
}
},
"required": [
"method",
"url"
],
"type": "object"
}
},
"type": "function"
}