# Tools using UI

1. [Step By Step Process](#id-1.-step-by-step-process)
2. [Demo Video](#id-2.-demo-video)

## 1. Step By Step Process

## 1. Managing Tools

Tools page (in the Policies section) provides facilities to manage Tools and create new ones.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-eebd808e3f3e06f0754cb756e06df2afa431f8b1%2Fimage%20(211).png?alt=media" alt=""><figcaption></figcaption></figure>

### 1.1 Importing Tools

Tools can be imported by clicking on "Import" button in Tools page as shown below:

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-7b8ee17e4d28cd2ba006e3299af22c429f8a1f26%2Fimage%20(270).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Important note on differences between imports of Tools vs. Modules and Policies.**

When importing Tools via message IDs:

1. Tool is non-editable when it is already published.
2. A single Tool can only be imported once, if it is already been imported then no additional import can take place.
3. Tools are imported as global entities for the Guardian instance, i.e. they are visible to all policy authors.
4. When Tools are imported as files (using file import) they behave in the same way as Policies and Modules.
   {% endhint %}

### 1.2 Creating Tools

Tools can be created from scratch by clicking on "Create New" button in Tools page:

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-7b9b42e5e22ea681eb7d77904fb3ea92fcbe0090%2Fimage%20(292).png?alt=media" alt=""><figcaption></figcaption></figure>

### 1.3 Exporting Tools

Tools can be exported as files and if a Tool has been already published then its corresponding Hedera messageID can be retrieved.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-53b40c76b96bfd6500011d634fa93094d77f384a%2Fimage%20(317).png?alt=media" alt=""><figcaption></figcaption></figure>

### 1.4 Deleting Tools

Tools that have not been published can only be deleted.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-75e2f07f90d09ae8c9efc3de5c8efa05838e9d04%2Fimage%20(318).png?alt=media" alt=""><figcaption></figcaption></figure>

### 1.5 Editing Tools

Tools that have not been published can only be edited.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-c8f8fe28475ccef17b1ee859d50844c5ac21850d%2Fimage%20(319).png?alt=media" alt=""><figcaption></figcaption></figure>

### 1.6 Changing Tools

While importing tool via file, or policy via file or IPFS, you can change used tools in preview dialog, it will change tools references in schemas and config automatically.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-ed09a3b83e62441e8acb526074bc4ff01a5d6bcb%2Fimage%20(587).png?alt=media" alt=""><figcaption></figcaption></figure>

### 1.7 Status changed to Dry Run mode

Users can now update the status of a tool directly from the Tools Page.

#### **1.7.1 How to Enable Dry Run:**

**1.7.1 Through Tools Page:**

1. Navigate to the Tools Page.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-0d681c738b19d7f7948a87001ec505e8a8b61046%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Find the tool you want to test.
3. Toggle the **Dry Run** switch to **ON**.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-ee29102901e5d2cdd32bc9657fa99df39e8470d0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

**1.7.2 Through Policy Configurator Page:**

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-1293480989b676e9705117b38bb9ae63ecf78798%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 2. Schemas

Tools can contain schemas, which are embedded in it. All the schemas related to tools can be seen in Schemas page with type : Tool Schemas.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-62fac39d13e8373debd5a50aad8a09ed9fc53460%2Fimage%20(320).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Schemas from Tools can be used not only inside Tools, but also in the context of the Policy into which the Tool that contains the schema was added.
{% endhint %}

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-41de753ca0ba48207b074c652a96b0d85b5c1f9f%2Fimage%20(321).png?alt=media" alt=""><figcaption></figcaption></figure>

## 3. How to Use Tools

### 3.1 Structure

Tools ‘insides’ are isolated from the Policy the Tool is added to. Policy components use *Variables* and *Input\Output Events* which constitute the interface for passing and retrieving data to/from the Tool.

{% hint style="info" %}
**Note:** Basic interoperation principles are similar to that of Modules and Policies
{% endhint %}

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-c8ad677abaa57761e77f00db39cdecbd4edadff9%2Fimage%20(322).png?alt=media" alt=""><figcaption></figcaption></figure>

#### 3.1.1 General Internal Structure

Tools are structurally similar to Policies, most of the capabilities available for creation of Policies are supported by Tools

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-793a460337bdfac17ee0d73b3552c08983b6faea%2Fimage%20(323).png?alt=media" alt=""><figcaption></figcaption></figure>

#### 3.1.2 Variables

Variables are used as an external interface of Tools. They allow the usage of names for structural elements of Tools, i.e. schemas, topics, roles, tokens, for setting their values inside the Policy where the Tool is used.

**Creating variables:**

Variables can be created/edited by using the right side tab name "Variables" in policy configurator as shown below:

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-0f9e39be71a04baa91baf2e9c63f607a25920210%2Fimage%20(324).png?alt=media" alt=""><figcaption></figcaption></figure>

#### 3.1.3 Input/Output Events

Similarly, Input/Output Events variables are external interfaces for events. It allows you to determine which events this Tool will accept and which events will be generated.

**Input Events** – It provides a facility for entry into the Tool. Correspondingly, in the Policy (outside of the Tool) it is an ingress point of events. Whereas, inside the Tool this is the point where the events get generated.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-2faf673be488907799d24913d8330aaa3ec01cc8%2Fimage%20(325).png?alt=media" alt=""><figcaption></figcaption></figure>

**Output Events** – It provides the facility for exiting the Tools. Correspondingly, in the Policy (outside of the Tool) this is the point where events get generated. Whereas, inside the Tool this is an ingress point for events destined for the ‘outside’.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-18cbc7e6941799896b844a5e1824f04004b5475f%2Fimage%20(326).png?alt=media" alt=""><figcaption></figcaption></figure>

### 3.2 Using Under Policies

Tools can be added to the Policy similarly to Module and/or Blocks.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-f86b7884a6302cafe640929bfebfe8fbb1323790%2Fimage%20(327).png?alt=media" alt=""><figcaption></figcaption></figure>

## 2. Demo Video

[Youtube](https://youtu.be/L0L0Kd7vkkU?si=4oB_YnRq7cOV4BMR\&t=110)
