uploadUpload.ts•1.69 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { uploadUpload } from "../../funcs/uploadUpload.js";
import { UploadRequestRequest$zodSchema } from "../../models/uploadop.js";
import { formatResult, ToolDefinition } from "../tools.js";
const args = {
request: UploadRequestRequest$zodSchema,
};
export const tool$uploadUpload: ToolDefinition<typeof args> = {
name: "upload-asset",
description:
`Uploads media assets (images, videos, raw files) to your Cloudinary product environment
Uploads media assets (images, videos, raw files) to your Cloudinary product environment. The file is securely stored
in the cloud with backup and revision history. Cloudinary automatically analyzes and saves important data about each
asset, such as format, size, resolution, and prominent colors, which is indexed to enable searching on those attributes.
Supports uploading from:
- Local file paths (SDKs/MCP server only). For MCP server path MUST start with file://
- Remote HTTP/HTTPS URLs
- Base64 Data URIs (max ~60 MB)
- Private storage buckets (S3 or Google Storage)
- FTP addresses
The uploaded asset is immediately available for transformation and delivery upon successful upload.
`,
scopes: ["librarian", "builder"],
args,
tool: async (client, args, ctx) => {
const [result, apiCall] = await uploadUpload(
client,
args.request,
{ 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);
},
};