/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: af8d0e1dda1d
 */
import { searchSearchAssets } from "../../funcs/searchSearchAssets.js";
import { SearchParameters$zodSchema } from "../../models/searchparameters.js";
import { formatResult } from "../tools.js";
import { appUri } from "../apps/uri.js";
const args = {
    request: SearchParameters$zodSchema.describe(`The search query parameters.`),
};
export const tool$searchSearchAssets = {
    name: "search-assets",
    description: `Provides a powerful query interface to filter and retrieve assets and their details

Returns a list of resources matching the specified search criteria.

Uses Lucene-like query language to search by descriptive attributes (public_id, filename, folder, tags, context), file details (resource_type, format, bytes, width, height), embedded data (image_metadata), and analyzed data (face_count, colors, quality_score). Supports aggregate counts and complex Boolean expressions.

Examples: tags:shirt AND uploaded_at>1d, resource_type:image AND bytes>1mb, folder:products OR context.category:electronics
`,
    scopes: ["librarian"],
    annotations: {
        "title": "Search Assets",
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "readOnlyHint": true,
    },
    _meta: {
        ui: { resourceUri: appUri("asset-gallery", "search-assets") },
    },
    args,
    tool: async (client, args, ctx) => {
        const [result] = await searchSearchAssets(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        return formatResult(result.value);
    },
};
//# sourceMappingURL=searchSearchAssets.js.map