> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jinba.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Jinba Toolbox

> Register Python tools in Jinba Toolbox from a flow

## Overview

The Jinba Toolbox tool registers a Python tool in [Jinba Toolbox](/en/pages/toolbox/quickstart) from within a flow. It creates the toolset on first use and creates or updates the tool on every run, so a flow can keep a generated tool in sync with its source.

## Key Features

* `JINBA_TOOLBOX_REGISTER_TOOL`
  * Register or update a Python tool identified by `org_id`, `tool_set_slug`, and `tool_slug`
  * Creates the toolset (private, Python sandbox) when it does not exist yet, using `tool_set_name` and `tool_set_description`
  * Sends `tool_name`, `tool_description`, and `code` on every run — changing `tool_name` between runs renames the tool
  * Does not publish a version: publish from the Toolbox web console once the tool is registered

## Authentication

Set the `api_key` config to a Jinba Toolbox API key (secret type `JINBA_TOOLBOX_API_KEY`). The optional `base_url` config overrides the Toolbox API URL configured for your Jinba Flow deployment.

**Note**: Treat API keys as sensitive information and never commit them to public repositories.

## Usage Examples

### Example: Register a Tool

```yaml theme={null}
- id: register_tool
  name: register_tool
  tool: JINBA_TOOLBOX_REGISTER_TOOL
  config:
    - name: api_key
      value: "{{secrets.JINBA_TOOLBOX_API_KEY}}"
  input:
    - name: org_id
      value: my-org
    - name: tool_set_slug
      value: greetings
    - name: tool_set_name
      value: Greetings
    - name: tool_slug
      value: hello
    - name: tool_name
      value: Hello
    - name: tool_description
      value: Return a greeting for the given name.
    - name: code
      value: |
        from pydantic import BaseModel


        class Input(BaseModel):
            name: str


        class Output(BaseModel):
            message: str


        def run(input: Input) -> Output:
            return Output(message=f"Hello, {input.name}!")
```

## Notes

* Inputs: `org_id` (Toolbox organization id or slug), `tool_set_slug` and `tool_slug` (lowercase letters, digits, and hyphens; up to 64 characters), `tool_set_name` and `tool_name` (up to 256 characters), `tool_set_description` and `tool_description` (optional, up to 4,096 characters), and `code` (up to 65,536 characters).
* `code` must define `Input` and `Output` pydantic `BaseModel` classes and a `run(input: Input) -> Output` function — Toolbox extracts the tool's I/O schema from them and rejects code that is missing any of them.
* `tool_set_name` and `tool_set_description` are used only when the toolset is created; an existing toolset is not renamed. An empty `tool_set_description` falls back to `tool_set_name`. An empty `tool_description` leaves an existing tool's description unchanged.
* `result` contains `tool_set_slug`, `tool_slug`, `tool_set_created`, and `tool_created` (`true` when the run created the toolset or tool rather than updating it).
* Concurrent registrations of the same `tool_set_slug` / `tool_slug` are not coordinated — serialize them in the flow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.