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

# Input/Output

> Variables - Input and Output

The `Input` and `Output` variables are key when building tools in Brain Studio. They let you receive data from the flow that invokes your tool and return results when its execution finishes.

## Inputs

Input values are defined from the inputs manager while you configure your tool. Each input you declare will be available at runtime through:

* `{{$input.name}}` inside any node.
* `$input.get('name', [defaultValue])` inside code nodes.

For example, if you configured an input called `city`:

```js theme={null}
// Gets the city input
const city = $input.get('city')

// Gets the city input
// If not found, sets the value to 'New York'
const city = $input.get('city', 'New York')

```

## Outputs

The outputs of a tool are defined from a code node using `$output.set(key, value)`. These values become available to the flow after the tool finishes.

```js theme={null}
const data = $memory.get('apiResponse')
$output.set('data', data)
```

You can set multiple outputs by calling `$output.set` multiple times (one per key).

<Info>
  Make sure the names you use in `$output.set('key', value)` match the outputs you declared in the tool's `end` node; that way the flow can consume them without errors.
</Info>
