New

Give Your Agent Access to Every Tool

Add two tools to your AI SDK agent and instantly access thousands of tools from the TPMJS registry. No configuration, no manual imports—just dynamic tool discovery and execution.

Quick Start

1

Install the packages

npm install @tpmjs/registry-search @tpmjs/registry-execute
pnpm add @tpmjs/registry-search @tpmjs/registry-execute
2

Add to your agent

import { streamText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { registrySearchTool } from '@tpmjs/registry-search';
import { registryExecuteTool } from '@tpmjs/registry-execute';

const result = streamText({
  model: anthropic('claude-sonnet-4-20250514'),
  tools: {
    // Your existing tools
    weather: weatherTool,
    database: databaseTool,

    // TPMJS registry access
    registrySearch: registrySearchTool,
    registryExecute: registryExecuteTool,
  },
  system: `You have access to thousands of tools via the TPMJS registry.
Use registrySearch to find tools, then registryExecute to run them.`,
  prompt: 'Search for web scraping tools and scrape https://example.com',
});
3

That's it!

Your agent can now discover and execute any tool from the registry. Here's what happens when a user asks for something:

User: "Search the web for AI news and summarize it"
Agent:
1. Calls registrySearch({ query: "web search" })
2. Finds @exalabs/ai-sdk::webSearch
3. Calls registryExecute({ toolId: "@exalabs/ai-sdk::webSearch", params: {...} })
4. Returns results to user

How It Works

registrySearchTool

Search the TPMJS registry to find tools for any task. Returns metadata including the toolId needed for execution.

Parameters

NameTypeRequiredDescription
querystringYesSearch query (keywords, tool names, descriptions)
categorystringNoFilter by category
limitnumberNoMax results (1-20, default 5)

Categories

web-scrapingdata-processingfile-operationscommunicationdatabaseapi-integrationimage-processingtext-analysisautomationai-mlsecuritymonitoring

Return Value

{
  "query": "web scraping",
  "matchCount": 3,
  "tools": [
    {
      "toolId": "@firecrawl/ai-sdk::scrapeTool",
      "name": "scrapeTool",
      "package": "@firecrawl/ai-sdk",
      "description": "Scrape any website into clean markdown",
      "category": "web-scraping",
      "requiredEnvVars": ["FIRECRAWL_API_KEY"],
      "healthStatus": "HEALTHY",
      "qualityScore": 0.9
    }
  ]
}

registryExecuteTool

Execute any tool from the registry by its toolId. Tools run in a secure sandbox—no local installation required.

Parameters

NameTypeRequiredDescription
toolIdstringYesTool identifier (format: package::name)
paramsobjectYesParameters to pass to the tool
envobjectNoEnvironment variables (API keys)

Example

// Execute a web search tool
const result = await registryExecuteTool.execute({
  toolId: '@exalabs/ai-sdk::webSearch',
  params: { query: 'latest AI news' },
  env: { EXA_API_KEY: 'your-api-key' },
});

// Result:
// {
//   toolId: '@exalabs/ai-sdk::webSearch',
//   executionTimeMs: 1234,
//   output: { results: [...] }
// }

Return Value

{
  "toolId": "@exalabs/ai-sdk::webSearch",
  "executionTimeMs": 1234,
  "output": { ... }
}

Environment Variables

Both packages support self-hosted registries via environment variables. This is useful for enterprise deployments or running your own tool registry.

VariableDefaultDescription
TPMJS_API_URLhttps://tpmjs.comBase URL for the registry API
TPMJS_EXECUTOR_URLhttps://executor.tpmjs.comURL for the sandbox executor

Self-Hosted Example

# Use your own TPMJS registry
export TPMJS_API_URL=https://registry.mycompany.com
export TPMJS_EXECUTOR_URL=https://executor.mycompany.com

Passing API Keys

Many tools require API keys (e.g., Firecrawl, Exa). The recommended approach is to wrap registryExecuteTool with your pre-configured keys.

Create a Wrapper (Recommended)

import { tool } from 'ai';
import { registryExecuteTool } from '@tpmjs/registry-execute';

// Pre-configure your API keys
const API_KEYS: Record<string, string> = {
  FIRECRAWL_API_KEY: process.env.FIRECRAWL_API_KEY!,
  EXA_API_KEY: process.env.EXA_API_KEY!,
};

// Create a wrapped version that auto-injects keys
export const registryExecute = tool({
  description: registryExecuteTool.description,
  parameters: registryExecuteTool.parameters,
  execute: async ({ toolId, params }) => {
    return registryExecuteTool.execute({ toolId, params, env: API_KEYS });
  },
});

Use the Wrapped Tool

import { streamText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { registrySearchTool } from '@tpmjs/registry-search';
import { registryExecute } from './tools';  // Your wrapped version

const result = streamText({
  model: anthropic('claude-sonnet-4-20250514'),
  tools: {
    registrySearch: registrySearchTool,
    registryExecute,  // Keys are auto-injected
  },
  system: `You have access to the TPMJS tool registry.
Use registrySearch to find tools, then registryExecute to run them.`,
  prompt: 'Scrape https://example.com and summarize the content',
});

How It Works

  1. registrySearch returns requiredEnvVars for each tool (e.g., ["FIRECRAWL_API_KEY"])
  2. Your wrapper automatically passes all configured keys to the executor
  3. The executor injects matching keys as environment variables in the sandbox
  4. Tools without required keys work with or without the wrapper

Security

🏝️

Sandboxed Execution

All tools run in an isolated Deno runtime on Railway. They cannot access your local filesystem or environment.

🔐

API Key Isolation

API keys are passed per-request and never stored. Each execution is stateless and isolated.

Registry-Only Execution

Only tools registered in TPMJS can be executed. No arbitrary code execution is possible.

🏥

Health Monitoring

Every tool is continuously health-checked. Broken tools are flagged and filtered from search results.

The Vision

We're building the npm for AI tools. Just as npm changed how developers share JavaScript packages, TPMJS aims to do the same for AI agent tools—a universal ecosystem where agents discover and use tools on-demand.

The registrySearch and registryExecute tools are just the beginning. Here's what's coming:

Coming Soon

Collections

Pre-configured tool bundles for specific domains. Think of them as “skill packs” for your AI agent.

// Future API concept
const tools = await tpmjs.loadCollection('web-scraping');
// Includes: scrapeTool, crawlTool, extractTool, searchTool...

const tools = await tpmjs.loadCollection('data-analysis');
// Includes: csvParser, jsonTransform, statistics, plotting...

// Or create your own private collections
const tools = await tpmjs.loadCollection('my-company/internal-tools');
Planned

API Keys & Rate Limiting

Personal API keys for authentication, usage tracking, and rate limiting. Enterprise features for teams including usage analytics and billing.

Planned

Tool Versioning

Pin specific tool versions in your agent configuration. Automatic compatibility checking and migration guides when tools update.

Planned

Private Registries

Run your own TPMJS instance for internal tools. Connect multiple registries (public + private) in a single agent. Enterprise SSO and access controls.

Planned

Streaming Execution

Stream tool outputs for long-running operations. Real-time progress updates and partial results for better UX.

Ready to Get Started?

Give your AI agent access to thousands of tools in minutes.