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
ThecreateClient function accepts a JinbaTBClientConfig object:
The SDK’s built-in default
baseUrl is https://toolbox-api.jinba.dev (the staging API). Set baseUrl to https://toolbox-api.jinba.io explicitly to talk to the production Toolbox.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
run() sends { input, version } to the organization run endpoint; the organization ID must come from the constructor or options.orgId.
Versions
Run History
Key Types
RunResult
The object returned fromrun() and test():
ToolSet
Tool
Error Handling
The SDK throwsJinbaTBError for non-2xx responses:
detail, not error), error.message is usually Request failed with status <code>; inspect statusCode to branch on the cause (for example 402 for insufficient credits).
Best Practices
- Set a default
organizationIdin the constructor to avoid passing it to every method. - Use environment variables for the API key — never hard-code credentials.
- Handle
JinbaTBErrorto distinguish between client errors (4xx) and server errors (5xx). - Increase
timeoutfor tool executions that run complex sandbox workloads. - Pin a version when calling
run()if your application depends on deterministic behavior.
Related
- REST API — Full endpoint reference
- MCP Integration — Use toolsets as MCP servers for AI agents
- Versioning & Publishing — Understand the version lifecycle