HTTP Integration
Create HTTP request tools — GET, POST, and custom request tools.
Factories
import {
createHttpTool,
createHttpGetTool,
createHttpPostTool,
} from '@ahzan-agentforge/core';createHttpGetTool
const getTool = createHttpGetTool({
name: 'fetch-weather',
description: 'Fetch weather data for a city',
baseUrl: 'https://api.weather.example.com',
headers: { 'Authorization': 'Bearer ...' },
});createHttpPostTool
const postTool = createHttpPostTool({
name: 'create-ticket',
description: 'Create a support ticket',
baseUrl: 'https://api.helpdesk.example.com',
headers: { 'Authorization': 'Bearer ...' },
});createHttpTool (generic)
const httpTool = createHttpTool({
name: 'api-call',
description: 'Make an HTTP request',
baseUrl: 'https://api.example.com',
headers: { 'Authorization': 'Bearer ...' },
});HttpToolConfig
interface HttpToolConfig {
name: string;
description: string;
baseUrl: string;
headers?: Record<string, string>;
timeout?: number;
}