> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/introduction.md

## Article Content:

# About the Tools Provider Service Plugin

The Tools Provider service plugin lets your app expose tools that Aria, the Wix AI assistant, can discover and use during conversations with Wix users. Aria is available in the Wix Harmony editor and dashboard, and in the site dashboard of Wix Studio and the Wix Editor. In the site dashboard, Aria can access data such as the CMS, Wix business solutions, and monitoring tools. Learn more about [Aria](https://dev.wix.com/docs/overview/ai-the-wix-platform/about-aria.md).

Using the Tools Provider service plugin, you can extend Aria's capabilities by exposing your app's functionality as tools. Any functionality your app can perform, you can expose as a tool for Aria to use. That includes retrieving data, running workflows, and completing actions in your app. It also includes functionality that uses 3rd-party APIs and services. 

## Use cases

+ [Get a package's status with Aria](https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/sample-flows.md) using a 3rd-party shipping service.
+ Create or retrieve an invoice through a 3rd-party invoicing service, such as QuickBooks.
+ Check inventory or place a fulfillment order with a dropshipping provider that your app uses.

## App Tools extension and the Tools Provider service plugin

Exposing a tool to Aria requires you to configure the following [backend extensions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/about-backend-extensions.md):

+ [App Tools](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/app-tools/about-app-tools-extensions.md): Declares which tools your app offers. Aria reads each tool's [description](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/app-tools/about-app-tools-extensions.md#effective-tool-descriptions) to decide when to call it, and its `requestSchema` to collect the information it needs from the Wix user.
+ Tools Provider: A service plugin that enables Aria to run a specified tool. 
  
Implement the [`runTool()`](https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/run-tool.md) handler. When Aria selects a tool, Wix calls your handler with that tool's `methodName` and a `payload` shaped by its `requestSchema`. Your handler routes on `methodName`, runs the tool, and returns data matching the tool's `responseSchema`. Aria uses that response to answer the Wix user in natural language.

For an end-to-end example, see [Get a package's status with Aria](https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/sample-flows.md).

## Set up

To set up the App Tools and Tools Provider extensions, go to [Extensions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/about-extensions.md) in your app's dashboard. 

### App Tools 

1. Click **Create Extension** in the top right.
2. Find **App Tools** and click **Create**.
3. Configure an array of tools in the JSON editor. For details, see [About App Tools Extensions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/app-tools/about-app-tools-extensions.md).
4. Click **Save**.

### Tools Provider
1. Click **Create Extension** in the top right.
2. Find **Tools Provider Config** and click **Create**.
3. Set the [Tools Provider Extension Config](https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/extension-config.md) to enable Wix to locate your tools and expose them to Aria.
4. Click **Save**.

You can implement this service plugin in a [CLI](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/supported-extensions/backend/app-tools/add-app-tools-extensions-with-the-wix-cli.md) app or as a [self-managed](https://dev.wix.com/docs/build-apps/develop-your-app/develop-a-self-managed-app/supported-extensions/about-self-managed-app-extensions.md) app. Use [`toolsProvider.provideHandlers()`](https://dev.wix.com/docs/build-apps/develop-your-app/develop-a-self-managed-app/supported-extensions/backend-extensions/add-self-managed-service-plugin-extensions-with-the-sdk.md) to define the following handler method:

| Method | Required |
| --- | --- |
| [`runTool()`](https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/run-tool.md) | Yes |


## Code examples

::::tabs
:::CLI

This is the basic code structure for implementing the Tools Provider service plugin with the Wix CLI:

```js
import { toolsProvider } from '@wix/app-tools/service-plugins';

toolsProvider.provideHandlers({
  runTool: async (payload) => {
    const { request, metadata } = payload;

    // Add your logic here

  }
});
```
:::
:::Self-managed
This is the basic code structure for implementing a self-hosted Tools Provider service plugin:

```js
import { createClient } from '@wix/sdk';
import { toolsProvider } from '@wix/app-tools/service-plugins';

const wixClient = createClient({
  auth: {
    appId: '<YOUR_APP_ID>',
    publicKey: '<YOUR_APP_PUBLIC_KEY>'
  },
  modules: { toolsProvider }
});

wixClient.toolsProvider.provideHandlers({
  runTool: async (payload) => {
    const { request, metadata } = payload;

    // Add your logic here

  }
});

// Implement a router to process all requests
express.post('/plugins-and-webhooks/*', (req, res) => {
  wixClient.process(req);
});
```
:::
::::

## See also

+ [About Aria](https://dev.wix.com/docs/overview/ai-the-wix-platform/about-aria.md)
+ [AI on the Wix Platform](https://dev.wix.com/docs/overview/ai-the-wix-platform/ai-on-the-wix-platform.md)
+ [App Tools](https://dev.wix.com/docs/overview/extensions-framework/backend-extensions/app-tools.md)
+ [About App Tools Extensions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/app-tools/about-app-tools-extensions.md)
+ [Add App Tools Extensions with the Wix CLI](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/supported-extensions/backend/app-tools/add-app-tools-extensions-with-the-wix-cli.md)
+ [App Tools Extension Files and Code](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/supported-extensions/backend/app-tools/app-tools-extension-files-and-code.md)
+ [Add App Tools Extensions with the Wix CLI (Headless)](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/extensions/backend/app-tools/add-app-tools-extensions-with-the-wix-cli.md)
+ [App Tools Extension Files and Code (Headless)](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/extensions/backend/app-tools/app-tools-extension-files-and-code.md)