/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { metadataFieldsListMetadataFields } from "../../funcs/metadataFieldsListMetadataFields.js";
import { formatResult } from "../tools.js";
const args = {
    external_ids: z.array(z.string()).describe("The external IDs of the metadata fields to retrieve. if not provided, all metadata fields will be returned.").optional(),
};
export const tool$metadataFieldsListMetadataFields = {
    name: "list-metadata-fields",
    description: `Lists all structured metadata fields defined in your Cloudinary product environment

Retrieves a list of all metadata fields in the product environment based on the provided filters.`,
    scopes: ["builder"],
    annotations: {
        "title": "List Metadata Fields",
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "readOnlyHint": true,
    },
    args,
    tool: async (client, args, ctx) => {
        const [result] = await metadataFieldsListMetadataFields(client, args.external_ids, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        return formatResult(result.value);
    },
};
//# sourceMappingURL=metadataFieldsListMetadataFields.js.map