This commit is contained in:
seb
2026-10-11 13:06:38 +02:00
parent 1149ffddcb
commit 0621416aa8
5 changed files with 31 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
import { defineTool, ToolError } from 'libllmorbiter';
import { TOOL_DESCRIPTIONS } from './prompts.js';
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
const DEFAULT_TAX_RATE = 19;
const DEFAULT_PRECISION = 6;
@@ -118,36 +118,36 @@ export function createNetGrossCalcTool() {
properties: {
note: {
type: 'string',
description: 'A note explaining what this price calculation is doing. This note will be displayed to the user while executing.',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.note,
},
gross: {
type: ['number', 'null'],
description: 'Gross price (incl. VAT) or null. When provided, computes net price and tax amount.',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.gross,
},
net: {
type: ['number', 'null'],
description: 'Net price (excl. VAT) or null. When provided, computes gross price and tax amount.',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.net,
},
taxRate: {
type: ['number', 'null'],
description: `Tax/VAT rate percentage (e.g. 19 for 19%, 7 for 7%) or null. Default ${DEFAULT_TAX_RATE}.`,
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.taxRate,
},
amount: {
type: ['number', 'null'],
description: 'Generic price amount or null when used with "from" ("gross" or "net").',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.amount,
},
from: {
type: ['string', 'null'],
enum: ['gross', 'net', null],
description: 'Direction when using "amount": "gross" (default) or "net".',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.from,
},
precision: {
type: ['number', 'null'],
description: `Decimal precision for net price API value or null (default ${DEFAULT_PRECISION}, between 2 and 8).`,
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.precision,
},
items: {
type: ['array', 'null'],
description: 'Optional array of prices or objects for batch calculation: [19.99, 49.95] or [{ gross: 19.99, taxRate: 7 }].',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.items,
items: {
type: 'object',
additionalProperties: false,