🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

agent-toolbelt

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agent-toolbelt

Official SDK for Agent Toolbelt — typed API client and LangChain tool wrappers for schema generation, text extraction, token counting, CSV conversion, and more.

latest
Source
npmnpm
Version
0.6.0
Version published
Weekly downloads
31
3.33%
Maintainers
1
Weekly downloads
 
Created
Source

agent-toolbelt

Official SDK for Agent Toolbelt — a suite of focused API tools for AI agents and developers.

Typed client + LangChain tool wrappers for stock research (investment thesis, earnings analysis, insider signals, valuation, bear/bull, head-to-head comparison, moat analysis, watchlist scan), schema generation, text extraction, token counting, CSV conversion, Markdown conversion, URL metadata, regex building, cron expressions, address normalization, color palette generation, brand kit creation, meeting action item extraction, prompt optimization, web summarization, and more — 28 tools total (8 stock + 20 utility).

Install

npm install agent-toolbelt

Get an API key

curl -X POST https://www.agenttoolbelt.live/api/clients/register \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

Typed Client

import { AgentToolbelt } from "agent-toolbelt";

const client = new AgentToolbelt({ apiKey: process.env.AGENT_TOOLBELT_KEY! });

Stock Research Tools

Seven tools that pull live data from Polygon.io, Finnhub, and Financial Modeling Prep, then synthesize Motley Fool-style analysis. Each call returns structured JSON with verdict, key drivers, and what to watch. US-listed equities only (NYSE, NASDAQ, AMEX).

Investment Thesis

const result = await client.stockThesis({
  ticker: "NVDA",
  timeHorizon: "3-5 years",
});
// result.verdict        → "bullish" | "neutral" | "bearish"
// result.oneLiner       → "Nvidia owns the essential infrastructure for the AI revolution..."
// result.keyStrengths   → ["Dominant ~80%+ data center GPU share", "CUDA software moat", ...]
// result.keyRisks       → ["Customer concentration", "Cyclical demand exposure", ...]
// result.watchFor       → "Data center revenue growth rate. Deceleration below 30% YoY..."

Earnings Analysis

const result = await client.earningsAnalysis({ ticker: "MSFT" });
// result.verdict        → "strong_compounder" | "consistent" | "mixed" | "volatile" | "deteriorating"
// result.beatRate       → "4/5 quarters beat (80%)"
// result.revenueTrend   → "accelerating" | "stable" | "decelerating" | "declining"
// result.lastQuarterSummary → "..."

Insider Signal

const result = await client.insiderSignal({ ticker: "AAPL" });
// result.signal         → "strong_buy" | "buy" | "neutral" | "sell" | "strong_sell"
// result.confidence     → "high" | "medium" | "low"
// result.interpretation → "Two C-suite executives bought ~47k shares in March (positive alignment)..."

Valuation Snapshot

const result = await client.valuationSnapshot({ ticker: "GOOGL" });
// result.verdict        → "very_cheap" | "cheap" | "fair" | "expensive" | "very_expensive"
// result.metrics.peRatio, result.metrics.evEbitda, result.metrics.fcfYield, result.metrics.roe
// result.buyZone        → "Below $135. Current $172 is fair but not a bargain."

Bear vs. Bull

const result = await client.bearVsBull({ ticker: "TSLA" });
// result.verdict        → "bull_wins" | "slight_bull" | "too_close" | "slight_bear" | "bear_wins"
// result.bullCase       → [{ argument: "...", detail: "..." }, ...]   // 3 items
// result.bearCase       → [{ argument: "...", detail: "..." }, ...]   // 3 items
// result.keyDebate      → "Will autonomous driving become a real revenue line by 2027?"

Compare Stocks

Head-to-head comparison of 2–3 tickers with a recommendation by investor goal.

const result = await client.compareStocks({ tickers: ["NVDA", "AMD"] });
// result.winner         → "NVDA" | "AMD" | "tied"
// result.oneLiner       → "NVDA wins on margins and software moat; AMD better value."
// result.byTicker       → { NVDA: { strengths: [...], concerns: [...] }, AMD: {...} }
// result.ifYouValue     → { growth: "NVDA", value: "AMD", quality: "NVDA" }

Moat Analysis

Buffett-style competitive moat assessment.

const result = await client.moatAnalysis({ ticker: "KO" });
// result.moatRating     → "wide" | "narrow" | "none"
// result.moatSources    → [{ type: "brand", strength: "strong", evidence: "..." }, ...]
// result.durabilityRead → "Coca-Cola's brand moat is among the most durable in consumer staples..."
// result.threats        → ["Health-conscious consumer shift", "Private label competition", ...]

Text Extractor

Pull structured data out of raw text — no regex required.

const result = await client.textExtractor({
  text: "Contact Sarah at sarah@acme.com or (555) 867-5309. Budget: $12,500.",
  extractors: ["emails", "phone_numbers", "currencies"],
});
// result.extracted.emails       → ["sarah@acme.com"]
// result.extracted.phone_numbers → ["+15558675309"]
// result.extracted.currencies   → ["$12,500"]

Token Counter

Never get surprised by context window costs again.

const result = await client.tokenCounter({
  text: longDocument,
  models: ["gpt-4o", "claude-3-5-sonnet", "gpt-3.5-turbo"],
});
// result.results["gpt-4o"].tokens            → 1842
// result.results["gpt-4o"].estimatedCost.input → 0.0000092 (USD)

Schema Generator

Describe your data in English, get back a schema.

const result = await client.schemaGenerator({
  description: "a SaaS user with name, email, plan tier, and usage limits",
  format: "typescript",
});
// result.schema → full TypeScript interface

CSV to JSON

Drop in CSV, get back typed JSON.

const result = await client.csvToJson({
  csv: rawCsvString,
  typeCast: true,   // "true" → true, "42" → 42, "" → null
});
// result.rows → [{ name: "Alice", age: 30, active: true }, ...]
// result.columnTypes → { name: "string", age: "number", active: "boolean" }

Markdown Converter

Clean up HTML for LLM consumption.

const result = await client.markdownConverter({
  content: scrapedHtml,
  from: "html",
  to: "markdown",
});
// result.output → clean Markdown without tags

URL Metadata

Enrich any link with context.

const result = await client.urlMetadata({ url: "https://example.com/article" });
// result.metadata.title       → "Article Title"
// result.metadata.description → "Meta description..."
// result.metadata.og          → { image: "...", type: "article" }

Other tools

// Natural language → cron expression
await client.cronBuilder({ description: "every weekday at 9am", timezone: "America/New_York" });

// Natural language → regex with code snippets
await client.regexBuilder({ description: "US phone numbers", testStrings: ["555-867-5309"] });

// Normalize messy US addresses to USPS format
await client.addressNormalizer({ address: "123 main st apt 4b, springfield, il 62701" });

// Generate color palettes from descriptions or hex colors
await client.colorPalette({ description: "calm fintech blue", count: 5 });

// Generate a full brand kit — colors, typography, CSS/Tailwind tokens
await client.brandKit({ name: "Solaris Health", industry: "healthcare", vibe: ["modern", "trustworthy"], format: "full" });

// Extract action items, decisions, and summary from meeting notes
await client.meetingActionItems({ notes: transcript, format: "full", participants: ["Sarah", "John"] });

// Analyze and improve an LLM prompt
await client.promptOptimizer({ prompt: "Summarize this and tell me the main points.", model: "gpt-4o", mode: "both" });

// Fetch a URL, strip boilerplate, return clean Markdown + AI summary
await client.webSummarizer({ url: "https://example.com/article", mode: "both", focus: "key arguments" });
// result.content           → clean Markdown
// result.summary.summary   → "2-4 sentence summary..."
// result.summary.keyPoints → ["point 1", "point 2", ...]

LangChain Integration

Use Agent Toolbelt tools directly in LangChain agents and chains.

import { AgentToolbelt } from "agent-toolbelt";
import { createLangChainTools } from "agent-toolbelt/langchain";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { ChatOpenAI } from "@langchain/openai";

const client = new AgentToolbelt({ apiKey: process.env.AGENT_TOOLBELT_KEY! });
const tools = createLangChainTools(client);

const agent = createReactAgent({
  llm: new ChatOpenAI({ model: "gpt-4o" }),
  tools,
});

const result = await agent.invoke({
  messages: [{ role: "user", content: "Extract all emails and phone numbers from this text: ..." }],
});

Available LangChain tools

Tool nameDescription
stock_thesisMotley Fool-style investment thesis with live data
earnings_analysisEPS beat/miss history + revenue trend read
insider_signalForm 4 interpretation: meaningful signal or routine noise?
valuation_snapshotP/E, P/S, EV/EBITDA, FCF yield → cheap/fair/expensive
bear_vs_bullSteelmanned bull and bear cases with net verdict
compare_stocksHead-to-head 2–3 ticker comparison with recommendation map
moat_analysisBuffett-style competitive moat assessment with durability outlook
extract_from_textExtract emails, URLs, phones, dates, currencies, addresses, names from text
count_tokensCount tokens and estimate cost across LLM models
generate_schemaGenerate JSON Schema / TypeScript / Zod from a description
csv_to_jsonConvert CSV to typed JSON with auto type casting
convert_markdownConvert HTML ↔ Markdown
fetch_url_metadataGet title, description, OG tags, favicon from a URL
build_regexBuild and test regex patterns from natural language
build_cronConvert schedule descriptions to cron expressions
normalize_addressNormalize US addresses to USPS format
generate_color_paletteGenerate color palettes with WCAG scores and CSS variables
generate_brand_kitGenerate full brand kit — colors, typography, CSS/Tailwind tokens
strip_image_metadataStrip EXIF/GPS/IPTC/XMP metadata from images for privacy
extract_meeting_action_itemsExtract action items, decisions, and summary from meeting notes
optimize_promptAnalyze and improve LLM prompts with scores and rewrite
compare_documentsSemantic diff between two document versions
extract_contract_clausesExtract key clauses and flag risks from contracts
mock_api_responseGenerate realistic mock data from a JSON Schema
pack_context_windowSelect the best content subset that fits a token budget
audit_dependenciesCheck npm/PyPI packages for known CVEs
summarize_web_pageFetch a URL, extract clean Markdown, generate AI summary with key points

All tools

28 tools available (8 stock + 20 utility). Free tier included — paid tiers available for higher volume. See pricing.

Stock research ($0.05 per call)

ToolDescription
stock-thesisMotley Fool-style investment thesis with verdict, strengths, risks
earnings-analysisEPS beat/miss history + revenue trend over 5 quarters
insider-signalForm 4 interpretation distinguishing real signal from routine
valuation-snapshotP/E, P/S, EV/EBITDA, FCF yield → cheap/fair/expensive verdict
bear-vs-bullSteelmanned bull and bear cases with net verdict
compare-stocksHead-to-head 2–3 ticker comparison with winner
moat-analysisBuffett-style competitive moat with durability rating

Utility tools

ToolDescription
schema-generatorJSON Schema / TypeScript / Zod from natural language
text-extractorExtract emails, URLs, phones, dates, currencies from text
token-counterToken counts and cost estimates across LLM models
csv-to-jsonCSV to typed JSON with auto type detection
markdown-converterHTML ↔ Markdown conversion
url-metadataTitle, description, OG tags, favicon from a URL
regex-builderNatural language → tested regex with code snippets
cron-builderNatural language → cron expression with next run times
address-normalizerNormalize US addresses to USPS format
color-paletteColor palettes with WCAG scores and CSS variables
brand-kitFull brand kit — colors, typography, CSS/Tailwind tokens
image-metadata-stripperStrip EXIF/GPS/IPTC/XMP metadata from images
meeting-action-itemsExtract action items and decisions from meeting notes
prompt-optimizerAnalyze and improve LLM prompts
document-comparatorSemantic diff between two document versions
contract-clause-extractorExtract clauses and flag risks from contracts
api-response-mockerGenerate realistic mock data from a JSON Schema
context-window-packerPack content into a token budget optimally
dependency-auditorAudit npm/PyPI packages for CVEs
web-summarizerFetch a URL, extract clean Markdown, generate AI summary with key points

Going to production

When the agent moves out of dev, a new set of questions shows up. What did it call last night? What arguments did it pass? Who approved the destructive one?

Cordon is an MCP gateway that sits in front of servers like this one. Point your client at Cordon instead of directly at Agent Toolbelt; Cordon forwards every call through and adds:

  • A real-time audit log of every tool invocation (name, arguments, response, latency)
  • Per-API-key policy: which tools each caller can use, under what conditions
  • Slack-based human approvals for tool calls you've flagged as high-risk

From the agent's perspective nothing changes — same tools, same schemas. Free tier covers 250 events/month.

License

MIT

Keywords

langchain

FAQs

Package last updated on 15 Jun 2026

Did you know?

Socket

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.

Install

Related posts