Skip to main content
Glama

asset_search

Search registered asset sources and list assets they contain. Filter by source ID or fuzzy query to locate images, fonts, and uploads for use in designs.

Instructions

Discover the asset sources registered on the CreativeEngine and search the assets they contain. Read-only — never creates a revision.

Without sourceId: lists every source id with its supported MIME types.

With sourceId: returns one page of assets as JSON { total, currentPage, nextPage, assets: [{ id, label, groups, uri, thumbUri, width, height, uploadedAt }] }. Typeface assets (e.g. the ly.img.gfonts Google Fonts source) additionally carry a compact typeface: { name, weights, styles } summary. query fuzzy-matches labels and tags.

The ly.img.workspace.images source is this workspace's own image store: every image the agent generated or imported AND every image the human uploaded in the browser editor, newest first. Uploads carry their original filename as label (the human will refer to it — "use logo-final.png" — so search that name), plus groups: ["uploads"] and an uploadedAt timestamp. "The image the user just uploaded" = the uploads-group asset with the newest uploadedAt.

⚠ Asset sources are deployment configuration — where their content lives (IMG.LY CDN, a customer host) is the server's business. NEVER fetch asset manifests (content.json) or hardcode cdn.img.ly URLs yourself; this tool and engine.asset.* are the only correct path. A source missing from the no-arg listing is not available on this server — say so instead of working around it.

To USE a result, apply it inside edit code — re-find it there, then either: (A) new block: const id = await engine.asset.apply(sourceId, (await engine.asset.findAssets(sourceId, { query, page: 0, perPage: 1 })).assets[0]) — then, if you resize the frame, set engine.block.setContentFillMode(id, "Cover") (resizing does NOT update the crop; without Cover a portrait photo forced into a landscape frame gets squished); (B) existing block: const fill = engine.block.createFill("image"); engine.block.setString(fill, "fill/image/imageFileURI", asset.meta.uri); engine.block.setFill(blockId, fill); engine.block.setContentFillMode(blockId, "Cover"). (C) fonts: re-find the family inside edit code and pass the payload straight to setFont — const { assets } = await engine.asset.findAssets("ly.img.gfonts", { query: name, page: 0, perPage: 20 }); const tf = assets.map((a) => a?.payload?.typeface).find((t) => t?.name === name); if (!tf) throw new Error("font lookup missed: " + assets.map((a) => a?.payload?.typeface?.name).join(", ")); engine.block.setFont(id, tf.fonts[0].uri, tf); engine.block.setTextFontWeight(id, "normal"). Take the EXACT name out of a page of results — fuzzy ranking can put it behind longer names (query "Lora" returns Explora first), so perPage: 1 fetches the wrong family. And always set the weight: tf.fonts[0] is the family's LIGHTEST declared weight (Thin/100 on Inter, Roboto, …), so setFont alone renders hairline text with no error. Never copy font URIs out of this tool into edit code. Do NOT use engine.asset.applyToBlock — on this server it silently no-ops (the block keeps its old fill, no error).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage index. Default 0.
queryNoFuzzy search over asset labels and tags.
perPageNoResults per page. Default 20, max 50.
sourceIdNoAsset source id. Omit to list all sources.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it delivers extensively. It discloses read-only semantics, pagination response shape, fuzzy matching behavior, upload grouping and ordering, the meaning of 'the image the user just uploaded', missing-source behavior, and the silent no-op of applyToBlock. This far exceeds what the schema or annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but densely informative with clear paragraph boundaries: core behavior, result shape, workspace image specifics, warnings, and usage recipes. Every section earns its place, and the most important read-only/never-creates-a-revision message is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with no annotations and no output schema, this description is remarkably complete. It explains return values, edge cases, font handling, upload semantics, integration code, and failure modes. An agent has everything needed to select and invoke the tool correctly, and to apply its results in edit code.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds meaningful usage nuance beyond the schema, especially for perPage in font lookups ('perPage: 1 fetches the wrong family'), query behavior on labels and tags, and sourceId-dependent result shape. It doesn't systematically restate each schema field, but it adds practical semantics where it matters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb and resource: 'Discover the asset sources registered on the CreativeEngine and search the assets they contain.' It explicitly states read-only behavior and distinguishes the no-sourceId listing mode from the sourceId search mode, making the tool's purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit when-to-use and when-not-to-use guidance: it explains the two invocation modes, warns against fetching asset manifests or hardcoding CDN URLs, prohibits engine.asset.applyToBlock, and provides specific code paths for using results in edit code. It also names the correct alternatives: this tool and engine.asset.* are the only correct path.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.