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

@synaptic-ai/toolmaker

v0.0.4

Published

Agent Toolmaker by Synaptic - easily create and manage AI Agent tools

Downloads

32

Readme

@synaptic-ai/toolmaker

ATM Toolmaker provides a type-safe way to define agent tools using Zod schemas and TypeScript.

Installation

npm install @synaptic-ai/toolmaker

Quick Start

Single-Capability Tool

The simplest way to create a tool with a single capability:

import { z } from 'zod';
import { Tool } from '@synaptic-ai/toolmaker';

// Define a single-capability tool directly
const greetingTool = new Tool({
  name: 'Greeting',
  description: 'A simple greeting tool',
  schema: z.object({
    name: z.string().describe("Name of the person to greet")
  }),
  runner: async (params) => {
    return {
      message: `Hello, ${params.name}!`,
      timestamp: new Date().toISOString()
    };
  }
});

export default greetingTool;

Multi-Capability Tool

For tools with multiple capabilities:

import { z } from 'zod';
import { Tool, ToolCapability } from '@synaptic-ai/toolmaker';

// Define your input schema
const greetSchema = z.object({
  name: z.string().describe("Name of the person to greet")
}).describe("Parameters for greeting");

// Create capability instances
const greetCapability = new ToolCapability({
  name: 'Greet',
  description: 'Greets a person by name',
  schema: greetSchema,
  runner: async (params) => {
    return {
      message: `Hello, ${params.name}!`,
      timestamp: new Date().toISOString()
    };
  }
});

const farewellCapability = new ToolCapability({
  name: 'Farewell',
  description: 'Says goodbye to a person',
  schema: greetSchema, // reusing the same schema
  runner: async (params) => {
    return {
      message: `Goodbye, ${params.name}!`,
      timestamp: new Date().toISOString()
    };
  }
});

// Create a multi-capability tool with all capabilities
const multiCapabilityTool = new Tool({
  name: 'Hello World',
  description: 'A simple tool with greeting capabilities',
  capabilities: [greetCapability, farewellCapability]
});

export default multiCapabilityTool;

Core Concepts

Tool

The Tool class is the main container for your AI tool and supports two patterns:

Single-Capability Pattern

// Create a tool with a single capability
const singleCapabilityTool = new Tool({
  name: string,             // Display name of your tool
  description: string,      // What your tool does
  schema: ZodType,          // Input parameters schema
  runner: async Function    // Function that executes the capability
});

Multi-Capability Pattern

// Create a tool with multiple capabilities
const multiCapabilityTool = new Tool({
  name: string,              // Display name of your tool
  description: string,       // What your tool does
  capabilities?: ToolCapability[] // Optional array of capabilities
});

Methods:

  • getCapabilities(): Returns all capabilities of the tool
  • getName(): Returns the tool's name
  • getDescription(): Returns the tool's description
  • openai(): Transforms capabilities into OpenAI function format

ToolCapability

ToolCapability represents a specific function your tool can perform:

const capability = new ToolCapability({
  name: string,        // Name of the capability
  description: string, // What this capability does
  schema: ZodType,     // Input parameters schema
  runner: Function     // Async function that executes the capability
});

Key features:

  • Type-safe input validation using Zod schemas
  • Automatic JSON Schema generation for AI consumption
  • Built-in TypeScript support

Toolkit

The Toolkit class allows you to group multiple tools together:

import { Toolkit } from '@synaptic-ai/toolmaker';

const toolkit = new Toolkit({
  tools: [tool1, tool2, tool3] // Array of Tool instances
});

Methods:

  • openai(): Transforms all tool capabilities into OpenAI function format
  • handler(params): Handles and processes tool calls from OpenAI
  • getTools(): Returns all tools in the toolkit
  • addTool(tool): Add a new tool to the toolkit

Processing tool calls:

// Process a single message with tool calls
const toolResponses = await toolkit.handler({ 
  message: chatCompletionMessage 
});

// Or process a ChatCompletion object
const toolResponses = await toolkit.handler({ 
  chatCompletion: chatCompletionObject 
});

Naming Conventions

When your tools are used with AI systems like OpenAI:

  • Single-capability tools: Function names are formatted as just tool_name in snake_case
  • Multi-capability tools: Function names are formatted as tool_name-capability_name in snake_case
  • Spaces in names are replaced with underscores
  • The handler method parses these function names to locate and execute the right capability

Best Practices

  1. Tool Design

    • Use the single-capability pattern for simple tools with one function
    • Use the multi-capability pattern for complex tools with multiple related functions
    • Set all capabilities at construction time
  2. Schema Design

    • Use descriptive names for schema properties
    • Add descriptions using .describe() for better AI understanding
    • Keep schemas focused and single-purpose
  3. Runner Implementation

    • Handle errors gracefully
    • Return structured data
    • Keep functions pure and side-effect free when possible

Directory Structure

Recommended structure for your tool:

your-tool/
├── src/
│   ├── capabilities/
│   │   └── greet/
│   │       ├── schema.ts      # Input schema definition
│   │       └── runner.ts      # Capability implementation
│   └── index.ts              # Tool export

TypeScript Support

Toolmaker is written in TypeScript and provides full type definitions. You get:

  • Type inference for schemas
  • Autocomplete for tool and capability options
  • Type checking for runner functions

Building and Sharing

Once you've created your tool, you can share it through the ATM CLI:

npm install -g @synaptic-ai/atm
  1. First, authenticate with ATM:
atm login
  1. Build your tool:
atm build
  1. Publish to ATM:
atm publish

After publishing, you'll receive a URL where you can view your tool on ATM. Other developers and AI agents can discover and use your tool through the ATM platform.

License

MIT