/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: ed1937d792b3 */ import * as z from "zod"; import { assetsGetResourceByAssetId } from "../../funcs/assetsGetResourceByAssetId.js"; import { formatResult, ToolDefinition } from "../tools.js"; import { appUri } from "../apps/uri.js"; const args = { asset_id: z.string().describe( "The asset ID of the resource. Must be a 32-character hexadecimal string.", ), colors: z.boolean().default(false).describe( "Whether to include color information (predominant colors and histogram of 32 leading colors). Default: false.", ), media_metadata: z.boolean().default(false).describe( "Whether to include IPTC, XMP, and detailed Exif metadata in the response. Default: false.", ), faces: z.boolean().default(false).describe( "Whether to include a list of coordinates of detected faces. Default: false.", ), quality_analysis: z.boolean().default(false).describe( "Whether to return quality analysis scores for the image. Default: false.", ), accessibility_analysis: z.boolean().default(false).describe( "Whether to return accessibility analysis scores for the image. Default: false.", ), pages: z.boolean().default(false).describe( "Whether to report the number of pages in multi-page documents (e.g., PDF). Default: false.", ), phash: z.boolean().default(false).describe( "Whether to include the perceptual hash (pHash) of the uploaded photo for image similarity detection. Default: false.", ), coordinates: z.boolean().default(false).describe( "Whether to include previously specified custom cropping coordinates and faces coordinates. Default: false.", ), versions: z.boolean().default(false).describe( "Whether to include details of all the backed up versions of the asset. Default: false.", ), max_results: z.int().default(10).describe( "Maximum number of derived assets to return. Default: 10.", ), derived_next_cursor: z.string().describe( "The cursor for the next page of derived assets when there are more derived images than max_results.", ).optional(), }; export const tool$assetsGetResourceByAssetId: ToolDefinition = { name: "get-asset-details", description: `Get resource by asset ID Returns the details of a single resource specified by its asset ID.`, scopes: ["librarian"], annotations: { "title": "Get Asset Details", "destructiveHint": false, "idempotentHint": true, "openWorldHint": false, "readOnlyHint": true, }, _meta: { ui: { resourceUri: appUri("asset-details", "get-asset-details") }, }, args, tool: async (client, args, ctx) => { const [result] = await assetsGetResourceByAssetId( client, args.asset_id, args.colors, args.media_metadata, args.faces, args.quality_analysis, args.accessibility_analysis, args.pages, args.phash, args.coordinates, args.versions, args.max_results, args.derived_next_cursor, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } return formatResult(result.value); }, };