"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createToolSchema = createToolSchema;
const zod_1 = require("zod");
const toolSchemaBuilder = (schema) => ({
    /**
     * Extends the basic schema with the given fields
     */
    extend: (fields) => toolSchemaBuilder(schema.extend(fields)),
    /**
     * Adds a page number to the schema, this is useful for tools that rely on pagination
     */
    withPagination: () => toolSchemaBuilder(schema.extend({
        // We need to coerce because LLMs were passing strings instead of numbers quite often (via MCP)
        page: zod_1.z.coerce
            .number()
            .positive()
            .nullable()
            .describe('Use this to paginate through the results. Starts at 1.'),
    })),
    /**
     * Builds the schema
     */
    build: () => schema,
    /**
     * Returns the zod schema so far
     */
    schema,
});
function createToolSchema() {
    return toolSchemaBuilder(zod_1.z.object({}));
}
//# sourceMappingURL=toolSchemaBuilder.js.map