GPT Tools

Set up Data Query and Script tools on a copilot's GPT Tools tab: the tool list, basic information, tool configuration, data sources, parameters, and writing the script.

📘

For developers only

This page is for developers who set up GPT tools. Technicians don't need it.

The GPT Tools tab of a copilot is where you create and configure the tools InSkill GPT can use to query structured data and run custom logic. For what tools are and when to use them, see About GPT Tools.

A Data Query tool open on the GPT Tools tab, showing its name, user levels, dependencies, tool configuration, and data source.

A Data Query tool on the GPT Tools tab

There are two tool types:

  • Data Query: pull exact values from structured data, such as parts lists, contact directories, or torque tables in Excel, CSV, TSV, or JSON.
  • Script: run JavaScript in a sandbox, for calculations, external data retrieval, or interacting with external systems.

The Tool List

The copilot's tools are listed on the left. Click a tool to open it.

The GPT Tools list, with the Add New drop-down, the built-in Solutions tool first, and four tools below it.

The tool list

Every copilot also has a built-in Solutions tool, listed first. It lets a Technician save a new solution from a GPT conversation by saying "Save solution". It has no settings.

The built-in Solutions tool selected, with the text: Save a new solution from a GPT conversation by saying Save solution.

The built-in Solutions tool

Configuring a Tool

Follow these steps to configure a GPT tool:

  1. Select the tool type, Data Query or Script, from the -- Add New -- drop-down.

  2. Enter the basic information for the tool: its Name, whether it is Published, the User Levels that can use it, and any Dependencies.

    The basic information fields for a tool: Name, Published, User Levels, and Dependencies.

    A tool's basic information

  3. Complete the Tool Configuration.

    The Tool Configuration section of a tool, with Templates, Description, and Output Format.

    The Tool Configuration section

  4. Set the Data Source for a Data Query tool, or the Parameters and script for a Script tool.

  5. Click Save, or click Cancel to discard your changes. The trash icon deletes the tool.

Click the ? icon at the top right of a tool to open a help panel with the supported formats and best practices for that tool type.

Description

Describe when InSkill GPT should use the tool, or what the tool does. InSkill GPT uses this description to decide whether the tool is relevant to a request, so it should clearly explain the kinds of questions or tasks the tool handles. For example:

Use when users ask about parts or part numbers.

Templates provide pre-written descriptions for common use cases. When you select a template, the Description field is optional.

Output format

Use Output Format to give additional guidance about how results should be returned — for example, which columns to include, or how values should be presented.

Data Query Tools

Data source

The About Data Query Tools help panel, listing the supported formats CSV, Excel, JSON, and TSV, and best practices for the data.

Data Query tools support structured data from Excel, CSV, TSV, and JSON. Depending on your configuration, data can come from:

SourceDescription
FileUpload a file directly to the tool.
URLProvide a URL where the data can be retrieved (.csv, .tsv, .json, or .xlsx).
ResourceSelect one resource to use as the data source.
Resource By NameSpecify a resource name, so the tool uses whichever resource carries that name in context.

Referencing a resource by name makes a tool reusable across contexts such as asset resources. A tool configured to use a resource named Parts List queries whichever Parts List applies, rather than being tied to one specific resource.

👍

Tip

Data should have a consistent tabular structure. Every column needs a header row, Excel header rows must not contain merged cells, and column names should be clear and descriptive.

The Data Source options for a Data Query tool: File, URL, Resource, and Resource By Name, with an uploaded Excel file.

The Data Source options, with an Excel file uploaded

Data path

For nested JSON, Data Path specifies where the queryable data sits within the structure. Given this data:

{
  "a": [],
  "b": {
    "c": []
  }
}

Use a as the data path to query the records in a, or b.c to query those. Leave Data Path blank when the queryable data is at the top level.

Script Tools

Parameters

Each parameter needs a name, and optionally a description so InSkill GPT understands what value to supply. Parameters can be marked as required: if required information is missing from the conversation, InSkill GPT asks for it before executing the tool.

For example, a service-history script might define start_date and end_date, both optional. A Technician could then ask:

What maintenance has been performed in the last 30 days?

The Parameters list of a Script tool, with Name, Type, Description, and Required columns, the Add Parameter button, and the Documentation link.

A Script tool's parameters

Writing the Script

Write the JavaScript in the Script editor below the parameters. The Documentation link above the editor opens the scripting reference.

The script reads the values InSkill GPT supplies from Inskill.GPT.args, by parameter name: a parameter named voltage is args.voltage. The script returns its result with return, and InSkill GPT uses the returned value in its response. A script that waits on anything, such as Inskill.Utils.webRequest or a promise, returns its result with session.done(result) instead.

For example, a Script tool named Current, described as "calculate current in Amps", with two required Number parameters, voltage (volts) and resistance (ohms):

var { args } = Inskill.GPT;
let current = args.voltage / args.resistance;
return `current: ${current}`;

The editor's syntax checker may mark this return as an error; hover over it to see return outside a function. The checker isn't reliable, and the script still runs.

Keys and other secrets the script uses belong in the Vault, not in the script. See also Scripts.