# tool_pipe

A RocketRide tool node that turns a whole inline pipeline into a single agent tool.

## What it does

Exposes one tool, `run_pipe`, to an AI agent. When the agent calls it, the input text
fans out to every connected output lane, the inline sub-pipeline runs synchronously, and
the value from the configured response lane is returned to the agent.

`tool_pipe` is the one `tool_*` node with real output lanes (`text`, `questions`,
`documents`, `table`, `answers`) on its `_source` channel. Wire them to other nodes on
the same canvas to shape the tool's behavior, and cap each connected branch with a
response node so results can flow back. As always, the agent binds through the `invoke`
capability.

The sub-pipeline run is fully isolated: the lane write is synchronous, so by the time it
returns the downstream response nodes have already populated their response values. Those
response entries are snapshotted and then removed so they don't leak into the parent
pipeline. The node has no external Python dependencies (`requirements.txt` is empty).

---

## Configuration


| Field | Type | Description |
|---|---|---|
| `tool_description` | string | Default empty. Natural-language description the agent uses to decide when to call this tool |
| `return_type` | string | Default "text". Which response lane value to return to the agent |


The single `default` profile ships with an empty `tool_description` and
`return_type: "text"`.

---

## Output lanes

The input string the agent passes is written to **every** connected output lane, lanes
without a listener are skipped:

| Lane        | Payload sent downstream                              |
|-------------|------------------------------------------------------|
| `text`      | The raw input string                                 |
| `questions` | A `Question` object containing the input as a question |
| `documents` | A single `Doc` with the input as `page_content`      |
| `table`     | The raw input string                                 |
| `answers`   | An `Answer` object with the input as the answer      |

---

## Available tools

### Pipeline


| Tool | Description |
|---|---|---|
| `run_pipe` | Run the connected pipeline with the given input and return its result. |


`run_pipe` takes one required parameter, `data` (string): the input to send to the
pipeline. An empty or missing `data` raises an error. The tool returns an object with a
single `result` string.

---

## Return value extraction

After the sub-pipeline completes, the node reads the response value named by
`return_type`:

- **`text`**: returned as a plain string.
- **`answers`**: the response is a list; the **first** answer is returned as a string.
- **`documents`** / **`table`**: list or dict values are JSON-serialised to a string for
  the agent.
- A missing value returns an empty string.

> **Gotcha:** if the sub-pipeline returns no data at all, the tool returns an empty
> `result`. Make sure each connected branch ends with a response node, and that the
> branch feeding the lane named by `return_type` actually produces a response.

---

<!-- ROCKETRIDE:GENERATED:PARAMS START -->
<!-- Generated by nodes:docs-generate. Do not edit by hand. -->

## Schema

| Field | Type | Description | Default |
|---|---|---|---|
| `tool_pipe.return_type` | `string` | **Return Type**<br/>Which response lane value to return to the agent | `"text"` |
| `tool_pipe.tool_description` | `string` | **Tool Description**<br/>Natural-language description the agent uses to decide when to call this tool | `""` |

## Source

[<svg viewBox="0 0 16 16" width="15" height="15" fill="currentColor" aria-hidden="true" style="vertical-align:-0.15em;margin-right:0.35em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg> View source](https://github.com/rocketride-org/rocketride-server/tree/develop/nodes/src/nodes/tool_pipe)
<!-- ROCKETRIDE:GENERATED:PARAMS END -->
