/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 11db1edd5083 */ import * as z from "zod"; import { uploadMappingsListUploadMappings } from "../../funcs/uploadMappingsListUploadMappings.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { folder: z.string().describe( "Get details of a specific mapping by folder name", ).optional(), next_cursor: z.string().describe( "The cursor for pagination. Use the next_cursor value from a previous response to get the next page of results.", ).optional(), max_results: z.int().default(10).describe( "The maximum number of results to return. Default is 10.", ), }; export const tool$uploadMappingsListUploadMappings: ToolDefinition< typeof args > = { name: "list-upload-mappings", description: `Retrieves a list of all upload mapping rules configured in your Cloudinary product environment Returns a list of all upload mappings defined for your account. Upload mappings allow you to map an upload preset to a specific folder and URL template. `, scopes: ["builder"], annotations: { "title": "List Upload Mappings", "destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true, }, args, tool: async (client, args, ctx) => { const [result] = await uploadMappingsListUploadMappings( client, args.folder, args.next_cursor, args.max_results, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } return formatResult(result.value); }, };