Skip to main content

Overview

The @jinba-toolbox/sdk package provides a type-safe client library for consuming tools registered in Jinba Toolbox. It wraps the REST API with convenient methods for listing toolsets, executing tools, managing versions, and retrieving run history. Target consumers:
  • AI agents executing tools
  • CLI tools for automation
  • Third-party applications integrating with Jinba Toolbox
  • Developers building on Jinba Toolbox

Installation

Quick Start

1

Import and create a client

2

List your toolsets

3

Execute a tool

Client Configuration

The createClient function accepts a JinbaTBClientConfig object:
Example with all options:
If you set organizationId in the constructor, you can omit it from individual method calls. Every method also accepts an optional orgId parameter to override the default.

API Reference

Organizations

ToolSets

Tools

Execution

Versions

Run History

Key Types

RunResult

The object returned from run() and test():

ToolSet

Tool

Error Handling

The SDK throws JinbaTBError for non-2xx responses:
A 408 status code is thrown when a request exceeds the configured timeout.

Best Practices

  • Set a default organizationId in the constructor to avoid passing it to every method.
  • Use environment variables for the API key — never hard-code credentials.
  • Handle JinbaTBError to distinguish between client errors (4xx) and server errors (5xx).
  • Increase timeout for tool executions that run complex sandbox workloads.
  • Pin a version when calling run() if your application depends on deterministic behavior.