/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { assetsListRawFiles } from "../../funcs/assetsListRawFiles.js";
import * as components from "../../models/components/index.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    type: operations.ListRawFilesType$inboundSchema.optional(),
    prefix: z.string().optional(),
    publicIds: z.array(z.string()).optional(),
    tags: z.boolean().optional(),
    nextCursor: z.string().optional(),
    maxResults: z.number().int().optional(),
    direction: components.Direction$inboundSchema.optional(),
    startAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    fields: z.array(components.FieldsSpec$inboundSchema).optional(),
};
export const tool$assetsListRawFiles = {
    name: "list-files",
    description: `Get raw assets

Retrieves a list of raw assets. Results can be filtered by various criteria like tags, moderation status, prefix, or specific public IDs.
`,
    scopes: ["librarian"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await assetsListRawFiles(client, args.type, args.prefix, args.publicIds, args.tags, args.nextCursor, args.maxResults, args.direction, args.startAt, args.fields, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return formatResult(value, apiCall);
    },
};
//# sourceMappingURL=assetsListRawFiles.js.map