assetsListVideos.ts•1.07 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { assetsListVideos } from "../../funcs/assetsListVideos.js";
import { ListVideosRequest$zodSchema } from "../../models/listvideosop.js";
import { formatResult, ToolDefinition } from "../tools.js";
const args = {
request: ListVideosRequest$zodSchema.optional(),
};
export const tool$assetsListVideos: ToolDefinition<typeof args> = {
name: "list-videos",
description: `Get video assets
Retrieves a list of video 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 assetsListVideos(
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);
},
};