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

# Return value

Returns a value from this block to the caller. Use to pass results to another blueprint.

<img src="https://mintcdn.com/writer/KruNpIclsgQbhj82/images/agent-builder/blueprints/return-value-block.png?fit=max&auto=format&n=KruNpIclsgQbhj82&q=85&s=3a1354d786dc46b7c9b3928b4bcda7b3" alt="" width="2310" height="1488" data-path="images/agent-builder/blueprints/return-value-block.png" />

## Overview

The **Return value** block allows you to chain multiple steps together to perform certain actions, and return a single value at the end of the chain. You can use it in the following scenarios:

* To return a value in [tool calling](/agent-builder/tool-calling)
* To return a value when a blueprint is invoked with the [**Run blueprint** block](/blueprints/runblueprint)

It passes the value specified in the **Value** field at the end of a chain of blocks.

### Return a value in tool calling

When an **Tool calling** block decides to run a tool, the tool can include any number of blocks and return a final value to the **Tool calling** block. Use the **Return value** block to define what the final return value is.

If you do not use the **Return value** block, the tool call executes the blocks that follow it but doesn't return a value to the **Tool calling** block.

<img src="https://mintcdn.com/writer/KruNpIclsgQbhj82/images/agent-builder/blueprints/return-value-tool-calling.png?fit=max&auto=format&n=KruNpIclsgQbhj82&q=85&s=57dc4439756ba669b0a674ff1fd7192e" alt="" width="2874" height="1470" data-path="images/agent-builder/blueprints/return-value-tool-calling.png" />

In the example above, the two **Return value** blocks provide the values of the "Call shipping API" block and the "Call order status API" HTTP Request blocks to the **Tool calling** block.

Without the **Return value** blocks, the "Call shipping API" and "Call order status API" blocks would execute, but their results would not be returned to the **Tool calling** block.

### Return a value from a blueprint

Use the **Return value** block to pass results to another blueprint.

<img src="https://mintcdn.com/writer/KruNpIclsgQbhj82/images/agent-builder/blueprints/return-value-run-blueprint.png?fit=max&auto=format&n=KruNpIclsgQbhj82&q=85&s=c39673550087f2f05075b04b60859086" alt="" width="2484" height="876" data-path="images/agent-builder/blueprints/return-value-run-blueprint.png" />

In the example above, the **Return value** block follows the **Text generation** block. It sets the results from the text generation block as the final return value of the blueprint. The blueprint passes this value when it is invoked with the **Run blueprint** block.

Without the **Return value** block, the blueprint would run and the **Text generation** block would execute, but its result would not be returned to the block that ran the blueprint.

## Fields

<table className="blueprintFields">
  <thead>
    <th>Name</th>
    <th>Type</th>
    <th>Control</th>
    <th>Default</th>
    <th>Description</th>
    <th>Options</th>
    <th>Validation</th>
  </thead>

  <tbody>
    <tr>
      <td>Value</td>
      <td>Text</td>
      <td>Textarea</td>

      <td>
        <span>-</span>
      </td>

      <td>-</td>

      <td>
        <span>-</span>
      </td>

      <td>
        <span>-</span>
      </td>
    </tr>
  </tbody>
</table>

## End states

Below are the possible end states of the block call.

<table className="blueprintFields">
  <thead>
    <th>Name</th>
    <th>Field</th>
    <th>Type</th>
    <th>Description</th>
  </thead>

  <tbody>
    <tr>
      <td>Success</td>
      <td>-</td>
      <td>success</td>
      <td>The value was returned successfully.</td>
    </tr>

    <tr>
      <td>Error</td>
      <td>-</td>
      <td>error</td>
      <td>There was an error returning the value.</td>
    </tr>
  </tbody>
</table>
