"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toolSearchFieldValuesOutputSchema = exports.toolSearchFieldValuesArgsSchemaTransformed = exports.toolSearchFieldValuesArgsSchema = exports.TOOL_SEARCH_FIELD_VALUES_DESCRIPTION = void 0;
const zod_1 = require("zod");
const fieldId_1 = require("../fieldId");
const filters_1 = require("../filters");
const outputMetadata_1 = require("../outputMetadata");
const toolSchemaBuilder_1 = require("../toolSchemaBuilder");
exports.TOOL_SEARCH_FIELD_VALUES_DESCRIPTION = `Tool: searchFieldValues

Purpose:
Search for unique values of a specific field in a table. Returns all unique values by default, or use the query parameter to narrow down results. This is useful for finding suggestions for field values when building filters or exploring data.

Usage Tips:
- Specify the table and field you want to search values for
- Query parameter: use it to narrow down the search to matching values
- Optionally add filters to further restrict the results
- Results are returned as a list of unique field values (limited to 100)
`;
exports.toolSearchFieldValuesArgsSchema = (0, toolSchemaBuilder_1.createToolSchema)({
    description: exports.TOOL_SEARCH_FIELD_VALUES_DESCRIPTION,
})
    .extend({
    table: zod_1.z.string().describe('The table to search in.'),
    fieldId: (0, fieldId_1.getFieldIdSchema)({
        additionalDescription: 'The ID of the field to search values for',
    }),
    query: zod_1.z
        .string()
        .describe('Query string to filter field values')
        .nullable(),
    filters: filters_1.filtersSchemaV2
        .nullable()
        .describe('Filters to apply to the query. Filtered fields must exist in the selected explore or should be referenced from the custom metrics.'),
})
    .build();
exports.toolSearchFieldValuesArgsSchemaTransformed = exports.toolSearchFieldValuesArgsSchema.transform((data) => ({
    ...data,
    filters: data.filters
        ? filters_1.filtersSchemaTransformed.parse(data.filters)
        : undefined,
    query: data.query ?? '',
}));
exports.toolSearchFieldValuesOutputSchema = zod_1.z.object({
    result: zod_1.z.string(),
    metadata: outputMetadata_1.baseOutputMetadataSchema,
});
//# sourceMappingURL=toolSearchFieldValuesArgs.js.map