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

@zioladev/provider-tools

v0.1.0

Published

Define, validate, and register structured browser tools for the experimental WebMCP API.

Readme

Ziola Provider Tools

Define, validate, and register structured browser tools for the experimental WebMCP API.

Repository: https://github.com/zioladev/provider-tools · License: Apache-2.0 · Zero runtime dependencies.

npm install @zioladev/provider-tools

Define your schema. Declare whether the tool reads or changes state. Provide the handler. The kit handles validation, registration, structured results, and runtime diagnostics.

import { defineProvider, mintConfirmationId } from '@zioladev/provider-tools';

const provider = defineProvider({
  name: 'sample-cafe',
  tools: [
    {
      name: 'get_menu',
      description: 'Returns the current café menu and prices.',
      effect: 'read',
      inputSchema: { type: 'object', properties: {}, additionalProperties: false },
      handler: async () => ({ menu: [{ id: 'latte', price: 4.75 }] }),
    },
    {
      name: 'place_order',
      description: 'Places an order for a menu item and returns a confirmation.',
      effect: 'state-changing',
      inputSchema: {
        type: 'object',
        properties: {
          itemId: { type: 'string', enum: ['drip', 'latte'] },
          quantity: { type: 'integer', minimum: 1, maximum: 20 },
        },
        required: ['itemId', 'quantity'],
        additionalProperties: false,
      },
      handler: async ({ itemId, quantity }) => ({
        executed: true,
        confirmationId: mintConfirmationId('ORDER'),
        data: { itemId, quantity },
      }),
    },
  ],
});

await provider.register();

That's the entire surface.

What the kit does for you

  • Feature-detects the WebMCP runtime (document.modelContext, falling back to navigator.modelContext) and no-ops when absent — human visitors are unaffected.
  • Validates definitions before registering: required inputSchema (supported subset), explicit effect, unique names (incl. a document-level registry).
  • Validates and rejects input at call time against your schema — no silent coercion.
  • Owns the result enveloperead handlers return plain data; the kit wraps it.
  • Enforces structured execution evidence for state-changing tools ({ executed, confirmationId | error }) so consumers never misclassify an action.
  • Isolates registration failures per tool and returns a structured RegisterResult.

What it does NOT do

No authorization, approval/binding, receipts, payments, cross-model conformance, or orchestration. This is the provider creation layer only. Those concerns live elsewhere by design — see docs/state-changing-tools.md.

Documentation

API reference

defineProvider(def: ProviderDef): Provider

Builds a provider. def is { name: string, tools: ProviderToolDef[] }.

ProviderToolDef:

| field | type | notes | | --- | --- | --- | | name | string | unique within the provider and the document registry | | description | string | narrow, specific, agent-facing | | effect | 'read' \| 'state-changing' | explicit; not inferred from the name | | inputSchema | JSON-Schema object | required; supported subset; additionalProperties: false | | handler | (input) => Promise<unknown> \| unknown | receives validated input |

Returns a Provider:

  • validate(): ValidationReport — static checks without registering.
  • register(): Promise<RegisterResult> — validate, detect runtime, register. Idempotent per document context.
  • tools: WebMCPTool[] — the built, runtime-shaped tools.

mintConfirmationId(prefix?: string): string

Optional helper that returns a short, human-looking id like ORDER-4821. You may supply your own confirmationId instead.

Other exports

wrap, detectRuntime, validateInput, validateDefinition, validateExecutionResult, isExecutionResult, SUPPORTED_TYPES, CODES, and the full set of types (Effect, ExecutionResult, RegisterResult, RuntimeInfo, ValidationReport, …).

Requirements

  • Zero runtime dependencies.
  • Node.js ≥ 20 for development (tests use --experimental-strip-types).
  • Targets Chrome builds exposing the experimental WebMCP surface (flag-gated or Origin-Trial-enabled). See browser support.

License

Apache-2.0 © Ziola. Source at github.com/zioladev/provider-tools. This is independent open-source tooling for the experimental WebMCP API; it makes no transaction-assurance, security, or conformance guarantees.