
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@rodgerai/tools
Advanced tools
Production-ready tool library for Rodger.ai agents. Pre-built, type-safe tools that work seamlessly with @rodger/core and @rodger/widgets.
npm install @rodger/tools
# or
pnpm add @rodger/tools
import { createAgent } from '@rodger/core';
import { cartBuilder, productLookup } from '@rodger/tools';
const agent = createAgent({
name: 'Shopping Assistant',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: {
cartBuilder,
productLookup
}
});
// Agent automatically uses tools when needed
const response = await agent.chat('Show me recovery products');
Creates a shopping cart preview that requires user approval before proceeding to checkout.
import { cartBuilder } from '@rodger/tools';
import { createAgent } from '@rodger/core';
const agent = createAgent({
name: 'Shopping Assistant',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: { cartBuilder },
systemPrompt: 'Help users build shopping carts. Always use cartBuilder to show cart previews.'
});
Features:
Input Schema:
{
protocolName: string; // e.g., "Weight Loss Starter Kit"
notes: string | null; // Optional cart notes
products: Array<{
entityId: number; // Product ID
name: string; // Product name
quantity: number; // Quantity (must be positive)
price?: number; // Optional price in cents
}>;
}
Output:
{
requiresApproval: true,
preview: {
products: [...],
protocolName: "Weight Loss Starter Kit",
notes: "Take with food"
},
message: "Review your cart before proceeding to checkout"
}
Widget: Use with CartBuilderUI from @rodger/widgets
Searches a product catalog by category. Returns formatted product list directly to the agent.
import { productLookup } from '@rodger/tools';
const agent = createAgent({
name: 'Product Expert',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: { productLookup },
systemPrompt: 'Help users find products. Use productLookup to search the catalog.'
});
Features:
Input Schema:
{
category: 'recovery' | 'performance' | 'metabolic' | 'cognitive' | 'aging' | 'immune' | 'all'
}
Output:
string // Formatted list: "ID: 123 | Product Name | $99.99 | 30 servings | https://..."
Widget: Use with ProductLookupUI from @rodger/widgets (optional)
Displays interactive button choices to guide the conversation.
import { quickActions } from '@rodger/tools';
const agent = createAgent({
name: 'Guide Assistant',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: { quickActions },
systemPrompt: 'Guide users with quick action buttons for common choices.'
});
Features:
Input Schema:
{
message: string; // Message above buttons
actions: Array<{
label: string; // Button text (short)
prompt: string; // Full prompt to send when clicked
}>; // Minimum 2 actions required
}
Output:
{
message: "What would you like to do?",
actions: [
{ label: "Browse Products", prompt: "Show me all products" },
{ label: "Get Recommendations", prompt: "Recommend products for me" }
]
}
Widget: Use with QuickActionsWidget from @rodger/widgets
Collects user email addresses early in conversations.
import { emailSignup } from '@rodger/tools';
const agent = createAgent({
name: 'Onboarding Assistant',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: { emailSignup },
systemPrompt: 'Collect user emails to personalize recommendations.'
});
Features:
Input Schema:
{
email: string; // User's email address
}
Output:
{
success: boolean;
email: string | null;
message: string; // Feedback message
}
Widget: Use with EmailSignupWidget from @rodger/widgets
Displays prominent call-to-action buttons for important actions.
import { ctaButton } from '@rodger/tools';
const agent = createAgent({
name: 'Sales Assistant',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: { ctaButton },
systemPrompt: 'Guide users to book consultations using CTA buttons.'
});
Features:
Input Schema:
{
label: string; // Button text
url: string; // Link destination
description?: string; // Optional description above button
variant?: 'primary' | 'secondary'; // Button style
}
Output:
{
label: "Book Your Consultation",
url: "https://cal.com/consultation",
description: "Schedule a free 15-minute call",
variant: "primary"
}
Widget: Use with CTAButtonWidget from @rodger/widgets
Tools that render UI components and often require user interaction:
Pattern:
{
requiresApproval?: true, // Optional: requires user approval
preview?: object, // Data for widget rendering
message: string // Human-readable message
}
Tools that fetch data without UI interaction:
Pattern:
{
// Returns data directly to agent
// No approval required
// No UI rendering (optional widget for display)
}
Combine tools with widgets for instant UI:
// Backend: app/api/chat/route.ts
import { createAgent } from '@rodger/core';
import { cartBuilder, quickActions } from '@rodger/tools';
const agent = createAgent({
name: 'Shopping Assistant',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: { cartBuilder, quickActions }
});
// Frontend: components/Chat.tsx
import { Thread } from '@rodger/ui';
import { CartBuilderUI, QuickActionsWidget } from '@rodger/widgets';
<Thread
widgets={{
cartBuilder: CartBuilderUI,
quickActions: QuickActionsWidget
}}
/>
Follow the Vercel AI SDK v5 patterns for consistent behavior:
// my-tool/tool.ts
import { tool } from 'ai';
import { z } from 'zod';
export const myTool = tool({
description: 'Clear description of what this tool does',
inputSchema: z.object({
input: z.string().describe('Input parameter description')
}),
execute: async ({ input }) => {
// Tool implementation
const result = await processInput(input);
return result;
}
});
// ui-tool/tool.ts
import { tool } from 'ai';
import { z } from 'zod';
export const uiTool = tool({
description: 'Tool that renders UI component',
inputSchema: z.object({
data: z.string()
}),
execute: async ({ data }) => {
return {
requiresApproval: true, // Requires user interaction
preview: {
data // Data for widget
},
message: 'User-friendly message'
};
}
});
Organize custom tools consistently:
packages/tools/src/my-tool/
├── tool.ts # Main tool definition
├── types.ts # Zod schemas and TypeScript types
└── index.ts # Barrel export
types.ts:
import { z } from 'zod';
export const myToolInputSchema = z.object({
input: z.string()
});
export type MyToolInput = z.infer<typeof myToolInputSchema>;
export type MyToolResult = {
output: string;
};
tool.ts:
import { tool } from 'ai';
import { myToolInputSchema } from './types';
export const myTool = tool({
description: 'My custom tool',
inputSchema: myToolInputSchema,
execute: async ({ input }) => {
return { output: input };
}
});
index.ts:
export { myTool } from './tool';
export type { MyToolInput, MyToolResult } from './types';
export { myToolInputSchema } from './types';
tool({
description: 'Search product catalog by category. Use when user asks about products, recommendations, or browsing.',
// ...
})
.describe():inputSchema: z.object({
query: z.string().describe('Search query (product name, category, or keyword)'),
limit: z.number().optional().describe('Maximum results to return (default: 10)')
})
execute: async ({ email }) => {
if (!email.includes('@')) {
return { success: false, message: 'Invalid email' };
}
// Process email
}
execute: async ({ query }) => {
try {
const results = await searchAPI(query);
return { results };
} catch (error) {
console.error('Search failed:', error);
return { results: [], error: 'Search temporarily unavailable' };
}
}
export type {
MyToolInput,
MyToolResult
} from './my-tool';
Some tools may require configuration:
# Product API (for productLookup)
NEXT_PUBLIC_APP_URL=https://your-app.com
# Custom tool APIs
MY_TOOL_API_KEY=your-api-key
Access in tools:
execute: async ({ query }) => {
const apiKey = process.env.MY_TOOL_API_KEY;
const response = await fetch(API_URL, {
headers: { Authorization: `Bearer ${apiKey}` }
});
return response.json();
}
Full TypeScript support with exported types:
import type {
// Cart Builder
CartBuilderInput,
CartBuilderResult,
CartProduct,
// Product Lookup
ProductCategory,
ProductLookupInput,
Product,
// Quick Actions
QuickActionsInput,
QuickAction,
QuickActionsResult,
// Email Signup
EmailSignupInput,
EmailSignupResult,
// CTA Button
CtaButtonInput,
CtaButtonResult
} from '@rodger/tools';
import { createAgent } from '@rodger/core';
import {
cartBuilder,
productLookup,
quickActions,
emailSignup,
ctaButton
} from '@rodger/tools';
const agent = createAgent({
name: 'E-commerce Assistant',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: {
cartBuilder,
productLookup,
quickActions,
emailSignup,
ctaButton
},
systemPrompt: `You are a helpful shopping assistant.
- Use productLookup to find products by category
- Use cartBuilder to create cart previews
- Use quickActions to guide users through choices
- Use emailSignup to collect emails early in conversation
- Use ctaButton for important actions like booking consultations
Always be helpful and guide users naturally through their shopping journey.`
});
const agent = createAgent({
name: 'Smart Assistant',
llm: { provider: 'openai', model: 'gpt-4o' },
tools: { productLookup, cartBuilder },
systemPrompt: `
When user asks about products:
1. Use productLookup to search catalog
2. Present options to user
3. Use cartBuilder when user wants to purchase
Always confirm before building cart.`
});
When adding new tools:
src/my-tool/types.ts with Zod schemas and TypeScript typestool.ts using tool() from 'ai'index.ts for barrel exportssrc/index.tsMIT
FAQs
Pre-built tools for Rodger.ai agents
We found that @rodgerai/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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.