> 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: App Tools Extension Files and Code

## Article: App Tools Extension Files and Code

## Article Link: 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

## Article Content:

# App Tools Extension Files and Code

When you generate an App Tools extension using the CLI, the CLI adds the following file to your project:

- `<your-extension-name>.extension.ts`: The [App Tools builder](#app-tools-builder), which declares the tools your app exposes to [Aria](https://dev.wix.com/docs/overview/ai-the-wix-platform/about-aria.md).

The CLI creates the file in the following default folder structure:

```bash
src/
  └── extensions/
      └── backend/
          └── app-tools/
              └── <your-extension-name>/
                  └── <your-extension-name>.extension.ts
```

You can move the file anywhere inside the `src/` folder as long as you update its path in `src/extensions.ts`.

## App Tools builder

The `<your-extension-name>.extension.ts` file declares the tools your app exposes to Aria. After you build and release, Aria uses these declarations to discover what tools exist and decide when to call them. This file shouldn't contain any business logic.

The file uses the following schema:

```typescript
import { extensions } from '@wix/astro/builders';

export default extensions.appTools({
  id: string,     // Auto-generated UUID. Don't change this manually.
  name: string,   // Internal name for this group of tools.
  tools: [        // Array of tool declarations. Min 1, max 100.
    {
      methodName: string,       // Required. Unique identifier for this tool.
      description: string,      // Required. Used by Aria to decide when to call the tool.
      requestSchema: object,    // Optional. JSON Schema for the input.
      responseSchema: object,   // Optional. JSON Schema for the output.
      activated: boolean        // Required. Whether Aria can call this tool.
    }
  ]
});
```

Here's an example file with a single tool declaration:

```typescript
import { extensions } from '@wix/astro/builders';

export default extensions.appTools({
  id: '00eeeac1-d01a-4d96-9d76-5617d8658735',
  name: 'my-tools',
  tools: [
    {
      methodName: 'get-order-status',
      description:
        'Returns the current fulfillment status, shipping carrier, and tracking number for a customer order. ' +
        'Use this tool when a Wix user asks where their order is, whether it has shipped, or needs a tracking number. ' +
        'Requires a valid orderId.',
      requestSchema: {
        type: 'object',
        properties: {
          orderId: { type: 'string', description: 'The order ID to look up.' }
        },
        required: ['orderId']
      },
      responseSchema: {
        type: 'object',
        properties: {
          status: { type: 'string' },
          trackingNumber: { type: 'string' }
        }
      },
      activated: true
    }
  ]
});
```

### App Tools extensions config

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Auto-generated UUID that uniquely identifies this extension. |
| `name` | `string` | Yes | Internal name for this group of tools. |
| `tools` | `array` | Yes | Array of tool declarations. Max: 100. |
| `tools[].methodName` | `string` | Yes | Unique identifier for the tool. Used to route calls in the [Tools Provider](https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/introduction.md) handler. Max: 30 characters.|
| `tools[].description` | `string` | Yes | Description Aria uses to decide when to call the tool. 10 to 1000 characters. See [effective tool descriptions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/app-tools/about-app-tools.md#effective-tool-descriptions) for guidance. |
| `tools[].requestSchema` | `object` | No | JSON Schema describing the tool's input. Helps Aria determine what information to gather before calling the tool. |
| `tools[].responseSchema` | `object` | No | JSON Schema describing the tool's output. |
| `tools[].activated` | `boolean` | Yes | Whether Aria can call this tool. Set to `true` for tools you want Aria to call. |

> **Note:** Wix doesn't check the `payload` Aria sends against your `requestSchema` before calling your handler. Handle missing or unexpected fields in your implementation.

## See also

- [Service Plugin Extension Files and Code](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/supported-extensions/backend/service-plugins/service-plugin-extension-files-and-code.md)
- [About the Tools Provider Service Plugin](https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/introduction.md)
- [Sample Flows](https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/sample-flows.md)