npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@forthebots/bazaar-sdk

v0.1.2

Published

TypeScript SDK for the noui.bot Agent Bazaar — billing, metering, and tool proxy for MCP servers

Readme

@forthebots/bazaar-sdk

TypeScript SDK for the noui.bot Agent Bazaar — billing, metering, and tool proxy for MCP servers.

One API key. Thousands of tools. Sub-cent precision.

Install

npm install @forthebots/bazaar-sdk

Quick Start

import { Bazaar } from '@forthebots/bazaar-sdk';

const client = new Bazaar({ apiKey: 'bz_your_consumer_key' });

// Discover tools
const { tools } = await client.catalog.list();
console.log(`${tools.length} tools available`);

// Call a tool (metered + billed automatically)
const result = await client.tools.call('wallet.balance', {
  wallet_address: '0xAgent1',
  chain: 'base',
});
console.log(result.result);           // Tool output
console.log(result.meta.cost_cents);  // What it cost
console.log(result.meta.latency_ms);  // How long it took

// Check usage
const usage = await client.usage.summary();
console.log(`Total spend: ${usage.total_spend}`);

For Providers

import { Bazaar, registerProvider } from '@forthebots/bazaar-sdk';

// 1. Register your MCP server
const { api_key } = await registerProvider({
  name: 'My Weather Tools',
  email: '[email protected]',
  endpoint_url: 'https://my-server.com/mcp',
  description: 'Real-time weather data for agents',
});

// 2. Use your provider key
const provider = new Bazaar({ apiKey: api_key });

// 3. Register your tools
await provider.tools.register([
  { tool_name: 'get_weather', description: 'Current weather', price_cents_override: 1 },
  { tool_name: 'get_forecast', description: '7-day forecast', price_cents_override: 2 },
]);

// 4. Check your earnings
const earnings = await provider.provider.summary();
console.log(`Net earnings: $${(earnings.net_earnings_cents / 100).toFixed(2)}`);

// 5. Connect Stripe for payouts
const { url } = await provider.provider.connectStripe('https://my-site.com/success');
console.log(`Complete onboarding: ${url}`);

For Consumers (Agent Developers)

import { Bazaar, registerConsumer } from '@forthebots/bazaar-sdk';

// 1. Register and get an API key
const { api_key } = await registerConsumer({
  name: 'My AI Agent',
  email: '[email protected]',
});

// 2. Create client
const client = new Bazaar({ apiKey: api_key });

// 3. Browse the catalog
const { tools } = await client.catalog.list();
tools.forEach(t => {
  console.log(`${t.tool_name} — ${t.pricing.price}/call`);
});

// 4. Call tools
const result = await client.tools.call('wallet.balance', { wallet: '0x...' });

// 5. Check balance
const { balance } = await client.balance.get();
console.log(`Remaining: ${balance}`);

// 6. Load more funds
const { url } = await client.balance.load(1000); // $10.00

MCP Middleware Integration

If you're building an MCP server and want to integrate Bazaar metering:

import { Bazaar } from '@forthebots/bazaar-sdk';

const bazaar = new Bazaar({ apiKey: 'bz_your_provider_key' });

// After each tool invocation, record it
await bazaar.meter.record({
  tool_name: 'my_tool',
  duration_ms: 150,
  tokens_used: 500,
  success: true,
});

API Reference

new Bazaar(config)

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Your Bazaar API key (bz_...) | | baseUrl | string | https://noui.bot | API base URL | | timeout | number | 30000 | Request timeout (ms) | | fetch | Function | globalThis.fetch | Custom fetch implementation |

Methods

| Method | Auth | Description | |--------|------|-------------| | client.catalog.list() | No | List all tools with pricing | | client.catalog.pricing() | No | Detailed pricing per tool | | client.tools.call(name, input) | Consumer | Call a tool through the proxy | | client.tools.register(tools) | Provider | Register/update your tools | | client.usage.list(opts?) | Any | Usage history | | client.usage.summary(period?) | Any | Aggregated usage stats | | client.balance.get() | Consumer | Check balance | | client.balance.load(cents) | Consumer | Add funds via Stripe | | client.stats.get() | No | Public platform metrics | | client.provider.summary(period?) | Provider | Earnings breakdown | | client.provider.connectStripe(url) | Provider | Start Stripe Connect | | client.provider.connectStatus() | Provider | Check Connect status | | client.provider.payout() | Provider | Trigger payout ($10 min) | | client.provider.payoutHistory() | Provider | Payout records | | client.meter.record(payload) | Any | Record tool invocation |

Static Functions

| Function | Description | |----------|-------------| | registerProvider(payload) | Register MCP server (no auth) | | registerConsumer(payload) | Get consumer API key (no auth) |

Error Handling

import { Bazaar, BazaarError } from '@forthebots/bazaar-sdk';

try {
  await client.tools.call('nonexistent_tool');
} catch (err) {
  if (err instanceof BazaarError) {
    console.log(err.status);  // 404
    console.log(err.code);    // "TOOL_NOT_FOUND"
    console.log(err.message); // "Tool not found"
  }
}

Pricing

  • Platform fee: 10% on paid calls
  • Free tools: No fees
  • Free tier: 100 calls per tool (default)
  • Precision: Sub-cent (microcents = 1/10000 of a cent)
  • Minimum payout: $10.00
  • Payout method: Stripe Connect (Express)

Links

License

MIT © Tombstone Dash LLC