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

@kindgi/tools

v0.1.7

Published

Tool authoring shape + registry + invocation for Kindgi. A tool is a typed, effect-declared unit of work — the same definition runs in-process for one flow, over MCP for another. Pure — no kernel dependency; the kernel bridges tools to node handlers separ

Readme

@kindgi/tools

Author, register, and invoke tools for Kindgi. A tool is a typed, effect-declared unit of work — the same definition runs in-process for one flow, over MCP for another. See @kindgi/specs/tool.schema.json for the wire contract.

Schema authoring surfaces

Tools declare their input and output shapes as either JSON Schema Draft 2020-12 objects or Zod v4 schemas. The wire form is always JSON Schema — Zod authoring is TS-user sugar the framework converts at author time via z.toJSONSchema().

A tool's schemas compile as Draft 2020-12 in Ajv's strict mode, which refuses loosely written JSON Schema (unknown keywords, union types, open tuples). An MCP server's tools (transport: 'mcp') are the exception: their schemas are the server's, compiled in the dialect they declare in $schema (draft-06, draft-07, 2019-09 or 2020-12) and without strict mode. Servers built with the TypeScript MCP SDK declare draft-07.

Authoring with JSON Schema

The wire form, portable to Python / Go / Rust pack authors publishing over MCP.

import { defineTool } from '@kindgi/tools';

const echo = defineTool({
  id: 'demo.echo' as never,
  description: 'Echo the input as output.',
  input: {
    type: 'object',
    properties: { msg: { type: 'string' } },
    required: ['msg'],
    additionalProperties: false,
  },
  output: {
    type: 'object',
    properties: { msg: { type: 'string' } },
    required: ['msg'],
  },
  handler: async (input) => {
    // JSON Schema authoring: input defaults to `unknown` at the type level.
    // Cast at the boundary — Ajv already validated the shape at invoke time.
    const { msg } = input as { msg: string };
    return { msg };
  },
});

Authoring with Zod v4

TS-first ergonomics. The framework converts to JSON Schema at author time, caches the wire form on tool.input / tool.output, and preserves the original Zod schemas on tool.inputZod / tool.outputZod so callers can z.infer<typeof tool.inputZod> for static types.

import { defineTool } from '@kindgi/tools';
import { z } from 'zod';

const InputSchema = z.object({ msg: z.string() });
const OutputSchema = z.object({ msg: z.string(), length: z.number().int() });

const echo = defineTool({
  id: 'demo.echo' as never,
  description: 'Echo the input with a length count (Zod-authored).',
  input: InputSchema,
  output: OutputSchema,
  handler: async (input) => {
    // Zod authoring: handler input type is `{ msg: string }` — no cast needed.
    return { msg: input.msg, length: input.msg.length };
  },
});

// Downstream inference (e.g., a wrapper that types calls by tool id):
type EchoInput = z.infer<typeof echo.value.inputZod>; // { msg: string }

When to pick which

Prefer JSON Schema when:

  • You publish the tool over MCP and expect non-TS consumers.
  • The manifest is machine-generated (adapter code, MCP client discovery).
  • You want to hand-tune JSON Schema keywords (format, pattern, contentMediaType) with maximum fidelity.

Prefer Zod when:

  • You author the tool in a TS package and want typed handlers without a duplicate type declaration.
  • You already validate other parts of your code with Zod and want a single source of truth.
  • Runtime + compile-time contract come from the same object.

Both are supported. Mixing is fine (Zod input, JSON Schema output, or vice versa).

Peer dependency

zod (>= 4.0.0) is a peer dependency. Workspaces that never author with Zod never install it and never pay any resolution cost. If you pass a Zod schema without zod installed, defineTool returns a typed invalid-schema error via the Result — no module-resolution crash.

Related

  • packages/schema/SPEC.md — §"Zod as optional authoring surface" for the primitive layer.
  • packages/guardrails/README.md — mirrors this pattern for check registration.