get_asset_details
Retrieve full metadata and compliance documentation for a specific PixelVault asset by its ID.
Instructions
Get full metadata and compliance documentation for a specific PixelVault asset by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset_id | Yes | The asset ID returned by search_assets. |
Implementation Reference
- src/index.js:129-151 (handler)Handler function for get_asset_details. Fetches asset metadata from the API using asset_id and returns formatted details including title, platform, compliance, license, format, price, description, and tone.
async function handleGetAssetDetails(args) { const { asset_id } = args; let asset; try { const data = await apiFetch(`/asset/${asset_id}`); asset = data.asset || data; } catch (err) { return { content: [{ type: 'text', text: `Error fetching asset ${asset_id}: ${err.message}` }], isError: true }; } const text = [ `PixelVault Asset Details`, `ID: ${asset.asset_id || asset.id}`, `Title: ${asset.title || 'Untitled'}`, `Platform: ${asset.source_platform || 'Unknown'}`, `Compliance: ${asset.compliance_status || 'Cleared'}`, `License: ${asset.license_type || asset.use_case || 'See listing'}`, `Format: ${asset.type || 'Video'} | Price: ${asset.price ? `$${asset.price}` : 'See site'}`, `Description: ${asset.description || 'N/A'}`, `Tone: ${asset.emotional_tone || 'N/A'}`, `Approve and license: ${SITE_URL}`, ].join('\n'); return { content: [{ type: 'text', text }] }; } - src/index.js:71-79 (schema)Schema definition for get_asset_details. Defines input as an object with a required 'asset_id' string property.
name: 'get_asset_details', description: 'Get full metadata and compliance documentation for a specific PixelVault asset by ID.', inputSchema: { type: 'object', properties: { asset_id: { type: 'string', description: 'The asset ID returned by search_assets.' }, }, required: ['asset_id'], }, - src/index.js:185-185 (registration)Registration of get_asset_details in the CallToolRequestSchema handler. Routes the 'get_asset_details' tool name to the handleGetAssetDetails function via a switch statement.
case 'get_asset_details': return await handleGetAssetDetails(args); - src/index.js:12-22 (helper)Helper function apiFetch used by handleGetAssetDetails to call the PixelVault API.
async function apiFetch(path, options = {}) { const res = await fetch(`${API_BASE}${path}`, { headers: { 'Content-Type': 'application/json', ...options.headers }, ...options, }); if (!res.ok) { const text = await res.text().catch(() => res.statusText); throw new Error(`PixelVault API error ${res.status}: ${text}`); } return res.json(); }