
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@agentforge/tools
Advanced tools
Tool library for TypeScript AI agents: web, data, file, and integration tools (HTTP, scraping, CSV, XML/JSON, Slack, databases).
Production-ready tools collection for AgentForge - 88 tools for web, data, file, utility, and agent operations
88 production-ready tools | Full TypeScript support | Comprehensive documentation | LangChain compatible
npm install @agentforge/tools
# or
pnpm add @agentforge/tools
# or
yarn add @agentforge/tools
Some tools require additional peer dependencies. Install only what you need:
Relational Database Tools (PostgreSQL, MySQL, SQLite):
# PostgreSQL
pnpm add pg @types/pg
# MySQL
pnpm add mysql2
# SQLite
pnpm add better-sqlite3 @types/better-sqlite3
This package provides 88 ready-to-use tools organized into 5 categories:
All tools feature:
import { httpGet, jsonParser, fileReader, calculator } from '@agentforge/tools';
// Make an HTTP GET request
const response = await httpGet.invoke({
url: 'https://api.example.com/data'
});
// Parse JSON
const parsed = await jsonParser.invoke({
json: '{"name": "John", "age": 30}'
});
// Read a file
const file = await fileReader.invoke({
path: './data.txt',
encoding: 'utf8'
});
// Perform calculations
const result = await calculator.invoke({
operation: 'add',
a: 10,
b: 20
});
Tools for web interactions, HTTP operations, and integrations.
webSearch - Search the web using DuckDuckGo (free) or Serper API (optional premium)
httpClient - Full-featured HTTP client with all methods (GET, POST, PUT, DELETE, PATCH)httpGet - Simple GET requestshttpPost - Simple POST requests with JSON bodywebScraper - Extract data from web pages using CSS selectorshtmlParser - Parse HTML and extract elementsextractLinks - Extract all links from HTMLextractImages - Extract all images from HTMLurlValidator - Validate and parse URLsurlBuilder - Build URLs from componentsurlQueryParser - Parse query parameterssendSlackMessage - Send messages to Slack channelsnotifySlack - Send notifications with @mentionsgetSlackChannels - List available Slack channelsgetSlackMessages - Read message history from channelscreateSlackTools() - Factory function for custom Slack configurationsearchConfluence - Search Confluence using CQL (Confluence Query Language)getConfluencePage - Get full page content by IDlistConfluenceSpaces - List all available Confluence spacesgetSpacePages - Get all pages from a specific spacecreateConfluencePage - Create new Confluence pagesupdateConfluencePage - Update existing Confluence pagesarchiveConfluencePage - Archive pages (move to trash)createConfluenceTools() - Factory function for custom Confluence configurationTools for data processing and transformation.
jsonParser - Parse JSON stringsjsonStringify - Convert objects to JSONjsonQuery - Query JSON using dot notationjsonValidator - Validate JSON syntaxjsonMerge - Merge multiple JSON objectscsvParser - Parse CSV to objectscsvGenerator - Generate CSV from objectscsvToJson - Convert CSV to JSONjsonToCsv - Convert JSON to CSVxmlParser - Parse XML to objectsxmlGenerator - Generate XML from objectsxmlToJson - Convert XML to JSONjsonToXml - Convert JSON to XMLarrayFilter - Filter arrays by property valuesarrayMap - Extract properties from array objectsarraySort - Sort arrays by propertyarrayGroupBy - Group arrays by propertyobjectPick - Pick specific properties from objectsobjectOmit - Omit specific properties from objectsneo4jQuery - Execute Cypher queries against Neo4jneo4jGetSchema - Get graph schema (labels, relationships, properties)neo4jFindNodes - Find nodes by label and propertiesneo4jTraverse - Traverse graph following relationshipsneo4jVectorSearch - Semantic search using vector indexes (GraphRAG)neo4jVectorSearchWithEmbedding - Semantic search with automatic embedding generationneo4jCreateNodeWithEmbedding - Create nodes with automatic embeddingsTools for file system operations.
fileReader - Read file contentsfileWriter - Write content to filesfileAppend - Append content to filesfileDelete - Delete filesfileExists - Check if file/directory existsdirectoryList - List directory contentsdirectoryCreate - Create directoriesdirectoryDelete - Delete directoriesfileSearch - Search for files by patternpathJoin - Join path segmentspathResolve - Resolve absolute pathspathParse - Parse path componentspathBasename - Get filename from pathpathDirname - Get directory from pathpathExtension - Get file extensionpathRelative - Get relative pathpathNormalize - Normalize pathsGeneral utility tools for common operations.
currentDateTime - Get current date/timedateFormatter - Format datesdateArithmetic - Add/subtract timedateDifference - Calculate date differencesdateComparison - Compare datesstringCaseConverter - Convert string casesstringTrim - Trim whitespacestringReplace - Replace substringsstringSplit - Split stringsstringJoin - Join string arraysstringSubstring - Extract substringsstringLength - Get string length/word countcalculator - Basic arithmetic operationsmathFunctions - Mathematical functions (sqrt, sin, cos, etc.)randomNumber - Generate random numbersstatistics - Calculate statistics (avg, median, stddev)emailValidator - Validate email addressesurlValidatorSimple - Validate URLsphoneValidator - Validate phone numberscreditCardValidator - Validate credit cards (Luhn algorithm)ipValidator - Validate IPv4/IPv6 addressesuuidValidator - Validate UUIDsimport { webSearch } from '@agentforge/tools';
// Basic search (no API key needed - uses DuckDuckGo)
const result = await webSearch.invoke({
query: 'TypeScript programming language',
maxResults: 10
});
console.log(`Found ${result.results.length} results from ${result.source}`);
result.results.forEach(r => {
console.log(`${r.title}: ${r.link}`);
console.log(` ${r.snippet}`);
});
// Premium search with Serper API (requires SERPER_API_KEY env var)
// Get your API key at: https://serper.dev
const premiumResult = await webSearch.invoke({
query: 'Latest AI developments 2026',
maxResults: 5,
preferSerper: true // Use Serper for Google search results
});
// Check metadata
console.log(`Source: ${premiumResult.source}`);
console.log(`Fallback used: ${premiumResult.metadata?.fallbackUsed}`);
console.log(`Response time: ${premiumResult.metadata?.responseTime}ms`);
Environment Setup:
# Optional: Add to your .env file for premium Google search
SERPER_API_KEY=your-serper-api-key-here
Input Schema:
{
query: string; // Search query (required)
maxResults?: number; // Max results to return (default: 10)
preferSerper?: boolean; // Prefer Serper over DuckDuckGo (default: false)
}
Output Schema:
{
results: Array<{
title: string; // Result title
link: string; // Result URL
snippet: string; // Result description/snippet
position: number; // Result position (1-based)
}>;
source: 'duckduckgo' | 'serper'; // Which provider was used
metadata?: {
fallbackUsed: boolean; // Whether fallback to DuckDuckGo occurred
responseTime: number; // Response time in milliseconds
};
}
DuckDuckGo vs Serper:
| Feature | DuckDuckGo (Free) | Serper (Premium) |
|---|---|---|
| API Key | ❌ Not required | ✅ Required (get key) |
| Cost | 🆓 Free | 💰 Paid (see pricing) |
| Search Engine | DuckDuckGo | |
| Rate Limits | Generous | Based on plan |
| Result Quality | Good | Excellent (Google results) |
| Use Case | Development, testing, low-volume | Production, high-quality results |
| Fallback | N/A | Auto-fallback to DuckDuckGo on error |
When to use each:
preferSerper: trueimport { webScraper } from '@agentforge/tools';
const result = await webScraper.invoke({
url: 'https://example.com',
selector: 'article h1',
extractText: true,
extractLinks: true,
extractMetadata: true
});
console.log(result.text);
console.log(result.links);
console.log(result.metadata);
import {
sendSlackMessage,
notifySlack,
getSlackChannels,
getSlackMessages,
createSlackTools
} from '@agentforge/tools';
// Send a simple message
const message = await sendSlackMessage.invoke({
channel: 'general',
message: 'Hello from AgentForge!'
});
// Send a notification with mentions
const notification = await notifySlack.invoke({
channel: 'alerts',
message: 'System alert: High CPU usage detected',
mentions: ['john', 'jane'] // Will send as: @john @jane System alert...
});
// List available channels
const channels = await getSlackChannels.invoke({
include_private: false // Only public channels
});
console.log(channels.data?.channels);
// Read message history
const history = await getSlackMessages.invoke({
channel: 'general',
limit: 50
});
console.log(`Found ${history.data?.count} messages`);
// Custom configuration (for multiple workspaces or custom bot settings)
const customTools = createSlackTools({
token: 'xoxb-your-custom-token',
botName: 'My Custom Bot',
botIcon: ':rocket:'
});
await customTools.sendMessage.invoke({
channel: 'general',
message: 'Message from custom bot!'
});
Environment Setup:
# Add to your .env file
SLACK_USER_TOKEN=xoxp-your-user-token
# OR
SLACK_BOT_TOKEN=xoxb-your-bot-token
Getting a Slack Token:
chat:write, channels:read, channels:historyxoxb- for bot or xoxp- for user)import {
searchConfluence,
getConfluencePage,
listConfluenceSpaces,
getSpacePages,
createConfluencePage,
updateConfluencePage,
archiveConfluencePage,
createConfluenceTools
} from '@agentforge/tools';
// Search for pages
const searchResults = await searchConfluence.invoke({
cql: 'type=page AND space=DOCS',
limit: 10
});
console.log(`Found ${searchResults.results.length} pages`);
// Get a specific page
const page = await getConfluencePage.invoke({
page_id: '123456'
});
console.log(`Page title: ${page.page.title}`);
console.log(`Content: ${page.page.content}`);
// List all spaces
const spaces = await listConfluenceSpaces.invoke({
limit: 50
});
console.log(`Found ${spaces.spaces.length} spaces`);
// Get pages from a space
const spacePages = await getSpacePages.invoke({
space_key: 'DOCS',
limit: 25
});
console.log(`Found ${spacePages.pages.length} pages in DOCS space`);
// Create a new page
const newPage = await createConfluencePage.invoke({
space_key: 'DOCS',
title: 'My New Page',
content: '<p>This is the page content in HTML format</p>',
parent_page_id: '789012' // Optional parent page
});
console.log(`Created page with ID: ${newPage.page.id}`);
// Update an existing page
const updated = await updateConfluencePage.invoke({
page_id: newPage.page.id,
title: 'Updated Page Title',
content: '<p>Updated content</p>'
});
console.log(`Updated to version ${updated.page.version}`);
// Archive a page
const archived = await archiveConfluencePage.invoke({
page_id: newPage.page.id,
reason: 'No longer needed'
});
console.log(archived.archived.note);
// Custom configuration (for multiple Confluence instances)
const customTools = createConfluenceTools({
apiKey: 'your-api-key',
email: 'your-email@example.com',
siteUrl: 'https://your-domain.atlassian.net'
});
await customTools.searchConfluence.invoke({
cql: 'type=page',
limit: 5
});
Environment Setup:
# Add to your .env file
ATLASSIAN_API_KEY=your-api-key-here
ATLASSIAN_EMAIL=your-email@example.com
ATLASSIAN_SITE_URL=https://your-domain.atlassian.net
Getting a Confluence API Key:
import { csvParser, arrayFilter, arraySort } from '@agentforge/tools';
// Parse CSV data
const parsed = await csvParser.invoke({
csv: 'name,age,city\nJohn,30,NYC\nJane,25,LA',
hasHeaders: true
});
// Filter the data
const filtered = await arrayFilter.invoke({
array: parsed.data,
property: 'age',
operator: 'greater-than',
value: 25
});
// Sort the results
const sorted = await arraySort.invoke({
array: filtered.filtered,
property: 'age',
order: 'desc'
});
console.log(sorted.sorted);
import {
initializeNeo4jTools,
neo4jQuery,
neo4jGetSchema,
neo4jFindNodes,
neo4jTraverse,
neo4jVectorSearch,
} from '@agentforge/tools';
// Initialize connection (reads from environment variables)
await initializeNeo4jTools();
// Get graph schema
const schema = await neo4jGetSchema.execute({});
console.log('Node Labels:', schema.schema.nodeLabels);
console.log('Relationships:', schema.schema.relationshipTypes);
// Execute Cypher query
const result = await neo4jQuery.execute({
cypher: 'MATCH (p:Person)-[:KNOWS]->(friend) WHERE p.name = $name RETURN friend',
parameters: { name: 'Alice' },
});
// Find nodes by label and properties
const people = await neo4jFindNodes.execute({
label: 'Person',
properties: { city: 'New York' },
limit: 10,
});
// Traverse graph from a starting node
const connections = await neo4jTraverse.execute({
startNodeId: 123,
relationshipType: 'KNOWS',
direction: 'outgoing',
maxDepth: 2,
limit: 50,
});
// Vector search for GraphRAG (requires vector index)
// Note: queryVector must be a complete array of numbers matching your embedding dimensions
const embeddingVector = new Array(1536).fill(0).map(() => Math.random()); // Example: 1536-dim vector
const similar = await neo4jVectorSearch.execute({
indexName: 'document_embeddings',
queryVector: embeddingVector,
limit: 5,
});
Environment Variables:
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=your-password
NEO4J_DATABASE=neo4j # Optional, defaults to 'neo4j'
import { fileReader, fileWriter, directoryList } from '@agentforge/tools';
// Read a file
const content = await fileReader.invoke({
path: './data.json',
encoding: 'utf8'
});
// Process and write back
const processed = JSON.parse(content.content);
processed.updated = new Date().toISOString();
await fileWriter.invoke({
path: './data-updated.json',
content: JSON.stringify(processed, null, 2),
createDirs: true
});
// List directory
const files = await directoryList.invoke({
path: './',
recursive: false,
includeDetails: true
});
console.log(files.files);
import { currentDateTime, dateArithmetic, dateDifference } from '@agentforge/tools';
// Get current date
const now = await currentDateTime.invoke({
format: 'custom',
customFormat: 'yyyy-MM-dd HH:mm:ss'
});
// Add 7 days
const future = await dateArithmetic.invoke({
date: now.iso,
operation: 'add',
amount: 7,
unit: 'days'
});
// Calculate difference
const diff = await dateDifference.invoke({
startDate: now.iso,
endDate: future.result,
unit: 'hours'
});
console.log(`${diff.difference} hours until ${future.result}`);
import { stringCaseConverter, stringReplace, stringSplit } from '@agentforge/tools';
// Convert to different cases
const camel = await stringCaseConverter.invoke({
text: 'hello world example',
targetCase: 'camel'
});
// Result: "helloWorldExample"
const kebab = await stringCaseConverter.invoke({
text: 'HelloWorldExample',
targetCase: 'kebab'
});
// Result: "hello-world-example"
// Replace text
const replaced = await stringReplace.invoke({
text: 'Hello World, Hello Universe',
search: 'Hello',
replace: 'Hi',
global: true
});
// Result: "Hi World, Hi Universe"
// Split string
const parts = await stringSplit.invoke({
text: 'apple,banana,orange',
delimiter: ','
});
// Result: ["apple", "banana", "orange"]
import { emailValidator, urlValidatorSimple, creditCardValidator } from '@agentforge/tools';
// Validate email
const email = await emailValidator.invoke({
email: 'user@example.com'
});
console.log(email.valid); // true
// Validate URL
const url = await urlValidatorSimple.invoke({
url: 'https://example.com/path'
});
console.log(url.valid); // true
// Validate credit card
const card = await creditCardValidator.invoke({
cardNumber: '4532-1488-0343-6467'
});
console.log(card.valid); // true (passes Luhn check)
All tools are compatible with LangChain through the @agentforge/core integration:
import { httpGet, jsonParser } from '@agentforge/tools';
import { toLangChainTool } from '@agentforge/core';
// Convert to LangChain tools
const langchainHttpGet = toLangChainTool(httpGet);
const langchainJsonParser = toLangChainTool(jsonParser);
// Use with LangChain agents
const tools = [langchainHttpGet, langchainJsonParser];
All tools follow the same structure:
interface Tool<TInput, TOutput> {
metadata: {
name: string;
description: string;
category: ToolCategory;
tags?: string[];
};
schema: ZodSchema<TInput>;
execute: (input: TInput) => Promise<TOutput>;
}
Most tools return a result object with a success field:
const result = await someTool.invoke({ ... });
if (result.success) {
console.log(result.data);
} else {
console.error(result.error);
}
All tools are fully typed with TypeScript:
import { httpGet } from '@agentforge/tools';
// TypeScript knows the input type
const result = await httpGet.invoke({
url: 'https://api.example.com',
headers: { 'Authorization': 'Bearer token' }
});
// TypeScript knows the output type
console.log(result.data);
All tools follow a consistent directory structure pattern for better maintainability and discoverability:
Each tool category is organized into its own directory with the following structure:
tool-category/
├── index.ts # Main exports, factory functions, default instances
├── types.ts # TypeScript interfaces, Zod schemas, configuration types
├── auth.ts # Authentication helpers (for API tools)
└── tools/ # Individual tool implementations
├── tool-1.ts
├── tool-2.ts
└── tool-3.ts
slack/
├── index.ts # Exports: sendSlackMessage, notifySlack, getSlackChannels, getSlackMessages, createSlackTools()
├── types.ts # SlackConfig, SlackMessageSchema, SlackChannelSchema, etc.
├── auth.ts # getSlackToken(), validateSlackConfig()
└── tools/
├── send-message.ts
├── notify.ts
├── get-channels.ts
└── get-messages.ts
types.ts ensure consistency across toolsEach tool category provides a factory function for custom configuration:
import { createSlackTools } from '@agentforge/tools';
// Custom configuration
const customTools = createSlackTools({
token: 'xoxb-your-custom-token',
botName: 'My Custom Bot',
botIcon: ':rocket:'
});
// Use custom tools
await customTools.sendMessage.invoke({
channel: 'general',
message: 'Hello from custom bot!'
});
Available factory functions:
createSlackTools(config?) - Slack integration toolscreateConfluenceTools(config?) - Confluence integration toolscreateHttpTools(config?) - HTTP client toolscreateScraperTools(config?) - Web scraping toolscreateCsvTools(config?) - CSV processing toolscreateJsonTools(config?) - JSON processing toolscreateXmlTools(config?) - XML processing toolscreateTransformerTools(config?) - Data transformation toolscreateFileOperationTools(config?) - File operation toolscreateDirectoryOperationTools(config?) - Directory operation toolscreatePathUtilityTools(config?) - Path utility toolscreateDateTimeTools(config?) - Date/time toolscreateStringUtilityTools(config?) - String utility toolscreateMathOperationTools(config?) - Math operation toolscreateValidationTools(config?) - Validation tools# Install dependencies
pnpm install
# Build the package
pnpm build
# Run tests
pnpm test
# Type check
pnpm typecheck
# Lint
pnpm lint
Contributions are welcome! Please see the main AgentForge repository for contribution guidelines.
MIT © 2026 Tom Van Schoor
Built with ❤️ by the AgentForge Team
FAQs
Tool library for TypeScript AI agents: web, data, file, and integration tools (HTTP, scraping, CSV, XML/JSON, Slack, databases).
We found that @agentforge/tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.