Configure a Query Execution Tool
- From Tools, click to add a new tool.
- From Tool type, select Query execution.
-
From Name, specify the unique name that the toolset uses when
calling this data query tool.
Use a consistent naming convention. Use a format like
<EntityName>_<QueryType>(for example,Orders_ByRegion,Employees_Active). -
From Description, enter a description explaining what the tool
returns and when to use it.
The model reads this first to decide whether this tool is relevant to a user question.
Note: You can enter a structured YAML in the Description field for a finer control of the Query execution tool. For more information, see About YAML Resources in Query Execution Tools.A good plain text description answers:
- What data does this tool return?
- What scope or time range does it cover (if any)?
- What is the unit of a record?
- Any important caveats or constraints?
Incorrect Returns sales.This description does not provide enough details and the model has no basis to prefer this over any other tool.
Correct Returns individual sale prices by date. Prices are expressed in decimals and show the average sale price by date. The currency unit is the US dollar. - From Query, select the data query that the tool encapsulates and its Result set.
-
From Input parameters, describe the filters that the model can
specify when calling the tool.
Each parameter corresponds to a real argument accepted by the data query.
Important: You do not have to configure Input parameters if you defined a YAML resource in the Description field. -
From Input parameter, select an input parameter previously
defined for the query in Queries > Input
parameters.
Note: Use parameters of type Parameter with a Return type set to
Integer,Float,String,Boolean, orList of <Integer| Float| String|Boolean>. -
From Description, describe what the input parameter
injects into the query.
For each parameter, the description must answer the following questions:
Question Examples of answers to include What is this? Zones where the plants were built.What is the accepted format? Upper case on first letter.Which are the valid values? Area, Unit, Building, Construction Area.What does omitting the parameter do? Note: If the parameter is mandatory, mention it explicitly in the Description property and also select the Is required property.If omitted, this parameter returns data for all zones by defaultAny dependency on another parameter? If specifying parameter major_versionalso requires to specify parameterminor_version, state this in the Description explicitly.REQUIRED: If you define a major_version, you must also define a minor_versionDoes it use internal jargon? Your database column names and internal codes mean nothing to the model. Explain what they mean explicitly. Instead of
Ticket priority levelwith allowed valuesP1,P2,P3, andBLK, give a useful description like:Ticket priority level:\n - P1: Critical — the system is down, there is no workaround\n - P2: High — a major feature is broken, a workaround exists\n - P3: Normal — this can be a non-blocking issue or an improvement request\n - BLK: Blocked — the system is waiting for an external dependency
Example for a parameter called
customer_name:Legal company name as stored in the system. Case-insensitive. Examples: 'CustomerX', 'CustomerY'. If you omit this parameter, the competency returns data for all customers.
-
Select Is required if the parameter is mandatory.
Recommendation: If your query does not work or produces meaningless results without this particular parameter, select this property and explain why it is helpful in the description.
- Optional:
From Allowed values, list all valid values exhaustively
for a finite set of possible values.
This is useful when the set of valid values is fixed and known for the input parameter. If you specify Allowed values, the competency only uses values from this list. This prevents the competency from inventing values that do not exist in your data.
For example,
open,shipped,cancelled,returned. - Optional:
From Pattern, enter a regular expression pattern for
strings with a predictable format, like dates, IDs, codes, etc.
The regular expression must provide the model with the exact format to produce. For example, you can use
^\\d{4}-\\d{2}-\\d{2}$for a date with aYYYY-MM-DDformat like2025-12-25.
-
From Input parameter, select an input parameter previously
defined for the query in Queries > Input
parameters.
-
From Fields, specify the result set fields that the competency
can return.
The Business Data Analysis competency uses the content of these fields to generate the answer. Specifying fields avoids loading unnecessary data into the tool context, which can be wasteful and cause errors.Important: You do not have to configure Fields if you defined a YAML resource in the Description field. For that use case, you configure them within a fieldssection of the YAML resource itself.From Description, give a detailed description of the field. The model must understand what the field contains to use it correctly. It is typically useful when:
- Some fields have a lot in common, to determine which field is the most appropriate.
- The field name is not clear enough (too technical).