list_assets
Retrieve and filter assets by type within the PlayCanvas Editor MCP Server to manage 3D web application resources efficiently.
Instructions
List all assets with the option to filter by type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | The type of assets to list. If not specified, all assets will be listed. |
Implementation Reference
- src/tools/asset.ts:37-39 (handler)The execution handler for the list_assets tool, which proxies the call to the WSS 'assets:list' endpoint with optional type filter.({ type }) => { return wss.call('assets:list', type); }
- src/tools/asset.ts:34-36 (schema)Input schema for the list_assets tool: optional 'type' parameter enum for filtering by asset type.{ type: z.enum(['css', 'cubemap', 'folder', 'font', 'html', 'json', 'material', 'render', 'script', 'shader', 'template', 'text', 'texture']).optional().describe('The type of assets to list. If not specified, all assets will be listed.') },
- src/tools/asset.ts:31-40 (registration)MCP tool registration block for 'list_assets', defining name, description, schema, and handler.mcp.tool( 'list_assets', 'List all assets with the option to filter by type', { type: z.enum(['css', 'cubemap', 'folder', 'font', 'html', 'json', 'material', 'render', 'script', 'shader', 'template', 'text', 'texture']).optional().describe('The type of assets to list. If not specified, all assets will be listed.') }, ({ type }) => { return wss.call('assets:list', type); } );
- src/server.ts:79-79 (registration)Calls registerAsset(mcp, wss) which invokes the tool registrations including list_assets.registerAsset(mcp, wss);
- extension/main.js:432-438 (helper)Backend implementation of the 'assets:list' WebSocket method, listing and filtering assets via PlayCanvas API, returning their JSON representations.wsc.method('assets:list', (type) => { let assets = api.assets.list(); if (type) { assets = assets.filter((asset) => asset.get('type') === type); } log('Listed assets'); return { data: assets.map((asset) => asset.json()) };