MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getAssetData

Function getAssetData

server/src/db/perspective-asset-db.ts:72–83  ·  view source on GitHub ↗
(
  perspectiveId: string,
  fileName: string
)

Source from the content-addressed store, hash-verified

70
71/** Get asset binary data for serving. */
72export async function getAssetData(
73 perspectiveId: string,
74 fileName: string
75): Promise<{ file_data: Buffer; file_mime_type: string; file_name: string } | null> {
76 const result = await query<{ file_data: Buffer; file_mime_type: string; file_name: string }>(
77 `SELECT file_data, file_mime_type, file_name
78 FROM perspective_assets
79 WHERE perspective_id = $1 AND file_name = $2`,
80 [perspectiveId, fileName]
81 );
82 return result.rows[0] || null;
83}
84
85/** List all assets for a perspective (metadata only, no binary). */
86export async function getAssetsByPerspective(perspectiveId: string): Promise<PerspectiveAsset[]> {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected