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

Function buildFormats

server/src/shared/formats.ts:71–593  ·  view source on GitHub ↗
(agentUrl: string)

Source from the content-addressed store, hash-verified

69 * Called once at startup with the resolved base URL.
70 */
71export function buildFormats(agentUrl: string): TrainingFormat[] {
72 return [
73 // ── Display ──────────────────────────────────────────────
74 {
75 format_id: { agent_url: agentUrl, id: 'display_static' },
76 name: 'Static display',
77 description: 'Static image display ad. Provide width and height in format_id to specify dimensions (e.g., 300x250, 728x90, 160x600, 320x50).',
78 accepts_parameters: ['dimensions'],
79 renders: [{ role: 'primary', parameters_from_format_id: true }],
80 assets: [
81 { item_type: 'individual', asset_id: 'image', asset_type: 'image', asset_role: 'hero_image', required: true,
82 requirements: { mime_types: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'], max_file_size_bytes: 200000 } },
83 { item_type: 'individual', asset_id: 'click_url', asset_type: 'url', asset_role: 'click_through', required: true,
84 requirements: { url_type: 'click_through' } },
85 { item_type: 'individual', asset_id: 'impression_tracker', asset_type: 'url', asset_role: 'third_party_tracking', required: false,
86 requirements: { url_type: 'impression_tracker' } },
87 ],
88 },
89
90 {
91 format_id: { agent_url: agentUrl, id: 'display_300x250' },
92 name: 'Medium rectangle (300x250)',
93 description: 'Standard IAB medium rectangle display ad.',
94 renders: [{ role: 'primary', dimensions: { width: 300, height: 250 } }],
95 assets: [
96 { item_type: 'individual', asset_id: 'image', asset_type: 'image', asset_role: 'hero_image', required: true,
97 requirements: { mime_types: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'], max_file_size_bytes: 200000, min_width: 300, min_height: 250 } },
98 { item_type: 'individual', asset_id: 'click_url', asset_type: 'url', asset_role: 'click_through', required: true,
99 requirements: { url_type: 'click_through' } },
100 ],
101 },
102
103 {
104 format_id: { agent_url: agentUrl, id: 'display_728x90' },
105 name: 'Leaderboard (728x90)',
106 description: 'Standard IAB leaderboard display ad.',
107 renders: [{ role: 'primary', dimensions: { width: 728, height: 90 } }],
108 assets: [
109 { item_type: 'individual', asset_id: 'image', asset_type: 'image', asset_role: 'hero_image', required: true,
110 requirements: { mime_types: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'], max_file_size_bytes: 200000, min_width: 728, min_height: 90 } },
111 { item_type: 'individual', asset_id: 'click_url', asset_type: 'url', asset_role: 'click_through', required: true,
112 requirements: { url_type: 'click_through' } },
113 ],
114 },
115
116 {
117 format_id: { agent_url: agentUrl, id: 'display_320x50' },
118 name: 'Mobile banner (320x50)',
119 description: 'Standard mobile banner display ad.',
120 renders: [{ role: 'primary', dimensions: { width: 320, height: 50 } }],
121 assets: [
122 { item_type: 'individual', asset_id: 'image', asset_type: 'image', asset_role: 'hero_image', required: true,
123 requirements: { mime_types: ['image/jpeg', 'image/png', 'image/webp'], max_file_size_bytes: 100000, min_width: 320, min_height: 50 } },
124 { item_type: 'individual', asset_id: 'click_url', asset_type: 'url', asset_role: 'click_through', required: true,
125 requirements: { url_type: 'click_through' } },
126 ],
127 },
128

Callers 3

getFormatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected