Back to Docs/OpenTool (npm)

OpenTool (npm)

The OpenTool framework and CLI for building OpenPond tools.

OpenTool (npm)

OpenTool is the TypeScript framework and CLI used by OpenPond. It packages your tools into a server that runs over HTTP and produces metadata for discovery.

Requirements

  • Node 20+

Install

bash
npm install opentool

Initialize a project

bash
mkdir my-tool cd my-tool npx opentool init

This scaffolds a tools/ directory and the OpenTool config files.

Project layout

Typical structure:

my-tool/ package.json tools/ greet.ts metadata.ts # optional

Validate and build

Validate your tools before deploying:

bash
npx opentool validate

Build for deployment:

bash
npx opentool build

This produces compiled output plus metadata.json for discovery.

Define a tool

ts
// tools/greet.ts import { z } from "zod"; export const schema = z.object({ name: z.string(), }); export const metadata = { name: "greet", description: "Say hello", }; export async function POST(req: Request) { const body = await req.json(); const { name } = schema.parse(body); return Response.json({ message: `Hello, ${name}!` }); }

CLI commands

Common commands you will use:

  • npx opentool dev (local dev server)
  • npx opentool validate (schema + tool validation)
  • npx opentool build (build + metadata)
  • npx opentool metadata (generate metadata without building)

Local dev

bash
npx opentool dev

Build

bash
npx opentool build

Metadata system

OpenTool supports a three-tier metadata system:

  1. Smart defaults from package.json
  2. Optional metadata.ts for app-level overrides
  3. Tool-level metadata inside each tool file

See METADATA.md in the OpenTool repo for the full schema and examples.

Adapters and exports

OpenTool ships additional modules you can import:

  • opentool/wallet for wallet helpers
  • opentool/adapters/hyperliquid for Hyperliquid
  • opentool/adapters/polymarket for Polymarket
  • opentool/store for store helpers
  • opentool/ai for AI utilities

Deploy to OpenPond

OpenPond detects the opentool dependency automatically and deploys your tools as a server. Public apps get a shareable tool page.

See also: OpenTool CONFIG Lifecycle

See also: Tools overview