|
| 1 | +import { companyenrichRequest, responseData } from '@/tools/companyenrich/request' |
| 2 | +import type { CompanyEnrichParams, CompanyEnrichResponse } from '@/tools/companyenrich/types' |
| 3 | +import type { ToolConfig } from '@/tools/types' |
| 4 | + |
| 5 | +export const companyenrichAdvancedTool: ToolConfig<CompanyEnrichParams, CompanyEnrichResponse> = { |
| 6 | + id: 'companyenrich_advanced', |
| 7 | + name: 'CompanyEnrich Advanced Request', |
| 8 | + description: |
| 9 | + 'Execute one of 42 allowlisted CompanyEnrich data, lookup or job operations. No retries, pagination, polling or result downloads. Email beta requires explicit opt-in; saved-list administration and account responses are excluded.', |
| 10 | + version: '1.1.0', |
| 11 | + errorExtractor: 'companyenrich-errors', |
| 12 | + params: { |
| 13 | + apiKey: { |
| 14 | + type: 'string', |
| 15 | + required: true, |
| 16 | + visibility: 'user-only', |
| 17 | + description: 'CompanyEnrich API key without the Bearer prefix', |
| 18 | + }, |
| 19 | + apiOperation: { |
| 20 | + type: 'string', |
| 21 | + required: true, |
| 22 | + visibility: 'user-or-llm', |
| 23 | + description: |
| 24 | + 'Documented operation ID from the advanced selector; exactly one request, without polling or downloads.', |
| 25 | + }, |
| 26 | + body: { |
| 27 | + type: 'json', |
| 28 | + required: false, |
| 29 | + visibility: 'user-or-llm', |
| 30 | + description: 'Full documented JSON body; export count must be explicit and at most 50,000.', |
| 31 | + }, |
| 32 | + queryParameters: { |
| 33 | + type: 'json', |
| 34 | + required: false, |
| 35 | + visibility: 'user-or-llm', |
| 36 | + description: 'Documented query parameters as an object.', |
| 37 | + }, |
| 38 | + pathParameters: { |
| 39 | + type: 'json', |
| 40 | + required: false, |
| 41 | + visibility: 'user-or-llm', |
| 42 | + description: 'Documented path parameters such as jobId or countryCode.', |
| 43 | + }, |
| 44 | + allow_beta: { |
| 45 | + type: 'boolean', |
| 46 | + required: false, |
| 47 | + visibility: 'user-only', |
| 48 | + description: 'Explicitly allow beta email operations and their credit costs (default false).', |
| 49 | + }, |
| 50 | + }, |
| 51 | + request: companyenrichRequest('advanced'), |
| 52 | + transformResponse: async (response) => { |
| 53 | + const data = await responseData(response) |
| 54 | + return { success: true, output: { data } } |
| 55 | + }, |
| 56 | + outputs: { |
| 57 | + data: { |
| 58 | + type: 'json', |
| 59 | + description: |
| 60 | + 'Complete API response; an object, array or count according to the selected operation.', |
| 61 | + }, |
| 62 | + }, |
| 63 | +} |
0 commit comments