asset_tool
Manage Webflow site assets and folders by creating folders, retrieving all assets and folders, and updating asset details.
Instructions
Designer Tool - Asset tool to perform actions like create folder, get all assets and folders, update assets and folders
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | The ID of the site. DO NOT ASSUME site id. ALWAYS ask user for site id if not already provided or known. use sites_list tool to fetch all sites and then ask user to select one of them. | |
| actions | Yes |
Implementation Reference
- src/tools/deAsset.ts:87-93 (handler)Handler function that executes the asset_tool logic by proxying to an external RPC implementation.async ({ siteId, actions }) => { try { return formatResponse(await assetToolRPCCall(siteId, actions)); } catch (error) { return formatErrorResponse(error); } }
- src/tools/deAsset.ts:31-86 (schema)Tool metadata and input validation schema for asset_tool, defining possible actions like create_folder, get_all_assets_and_folders, update_asset.{ title: "Designer Asset Tool", description: "Designer Tool - Asset tool to perform actions like create folder, get all assets and folders, update assets and folders", inputSchema: z.object({ ...SiteIdSchema, actions: z.array( z.object({ create_folder: z .object({ name: z.string().describe("The name of the folder to create"), parent_folder_id: z .string() .optional() .describe( "The id of the parent folder to move the folder to." ), }) .optional() .describe("Create a folder on the site"), get_all_assets_and_folders: z .object({ query: z .enum(["all", "folders", "assets"]) .describe("Query to get all assets and folders on the site"), filter_assets_by_ids: z .array(z.string()) .describe("Filter assets by ids") .optional(), }) .optional() .describe("Get all assets and folders on the site"), update_asset: z .object({ asset_id: z.string().describe("The id of the asset to update"), name: z .string() .optional() .describe("The name of the asset to update"), alt_text: z .string() .optional() .describe("The alt text of the asset to update"), parent_folder_id: z .string() .optional() .describe( "The id of the parent folder to move the asset to." ), }) .optional() .describe("Update an asset on the site"), }) ), }), },
- src/tools/deAsset.ts:29-94 (registration)Direct registration of the asset_tool on the McpServer instance.server.registerTool( "asset_tool", { title: "Designer Asset Tool", description: "Designer Tool - Asset tool to perform actions like create folder, get all assets and folders, update assets and folders", inputSchema: z.object({ ...SiteIdSchema, actions: z.array( z.object({ create_folder: z .object({ name: z.string().describe("The name of the folder to create"), parent_folder_id: z .string() .optional() .describe( "The id of the parent folder to move the folder to." ), }) .optional() .describe("Create a folder on the site"), get_all_assets_and_folders: z .object({ query: z .enum(["all", "folders", "assets"]) .describe("Query to get all assets and folders on the site"), filter_assets_by_ids: z .array(z.string()) .describe("Filter assets by ids") .optional(), }) .optional() .describe("Get all assets and folders on the site"), update_asset: z .object({ asset_id: z.string().describe("The id of the asset to update"), name: z .string() .optional() .describe("The name of the asset to update"), alt_text: z .string() .optional() .describe("The alt text of the asset to update"), parent_folder_id: z .string() .optional() .describe( "The id of the parent folder to move the asset to." ), }) .optional() .describe("Update an asset on the site"), }) ), }), }, async ({ siteId, actions }) => { try { return formatResponse(await assetToolRPCCall(siteId, actions)); } catch (error) { return formatErrorResponse(error); } } );
- src/tools/deAsset.ts:8-13 (helper)Helper function used by the handler to invoke the RPC call for asset_tool.const assetToolRPCCall = async (siteId: string, actions: any) => { return rpc.callTool("asset_tool", { siteId, actions: actions || [], }); };
- src/mcp.ts:60-60 (registration)High-level registration call for designer tools, including asset_tool.registerDEAssetTools(server, rpc);