get_wwdc_video
Retrieve complete WWDC session content including full transcript, code examples, and resources for offline access.
Instructions
Access complete WWDC session content including full transcript, code examples, and resources. Use after finding videos with list_wwdc_videos or search_wwdc_content. Provides offline access to entire session content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | WWDC year. Example: "2025" | |
| videoId | Yes | Session ID. Example: "10101" for keynote, "238" for session 238. | |
| includeTranscript | No | Include full session transcript with timestamps. Default: true | |
| includeCode | No | Include all code examples from the session. Default: true |
Implementation Reference
- src/tools/wwdc/wwdc-handlers.ts:229-249 (handler)Main handler function that loads video data via loadVideoData(year, videoId) and formats the result using formatVideoDetail(). Catches and logs errors.
/** * Get WWDC video details */ export async function handleGetWWDCVideo( year: string, videoId: string, includeTranscript: boolean = true, includeCode: boolean = true, ): Promise<string> { try { // Load video data directly const video = await loadVideoData(year, videoId); return formatVideoDetail(video, includeTranscript, includeCode); } catch (error) { logger.error('Failed to get WWDC video:', error); const errorMessage = error instanceof Error ? error.message : String(error); return `Error: Failed to get WWDC video: ${errorMessage}`; } } - Formats video details including title, speakers, topics, resources, chapters, transcript (with timestamped segments), code examples, and related videos.
function formatVideoDetail( video: WWDCVideo, includeTranscript: boolean, includeCode: boolean, ): string { let content = `# ${video.title}\n\n`; content += `**WWDC${video.year}** | [Watch Video](${video.url})\n\n`; // Basic information if (video.duration) { content += `**Duration:** ${video.duration}\n`; } if (video.speakers && video.speakers.length > 0) { content += `**Speakers:** ${video.speakers.join(', ')}\n`; } if (video.topics.length > 0) { content += `**Topics:** ${video.topics.join(', ')}\n`; } // Resource links if (video.resources.hdVideo || video.resources.sdVideo || video.resources.resourceLinks) { content += '\n**Resources:**\n'; if (video.resources.hdVideo) { content += `- [HD Video](${video.resources.hdVideo})\n`; } if (video.resources.sdVideo) { content += `- [SD Video](${video.resources.sdVideo})\n`; } if (video.resources.resourceLinks && video.resources.resourceLinks.length > 0) { video.resources.resourceLinks.forEach(link => { content += `- [${link.title}](${link.url})\n`; }); } } // Chapters if (video.chapters && video.chapters.length > 0) { content += '\n## Chapters\n\n'; video.chapters.forEach(chapter => { content += `- **${chapter.timestamp}** ${chapter.title}\n`; }); } // Transcript if (includeTranscript && video.transcript) { content += '\n## Transcript\n\n'; // If there are timestamped segments, use them if (video.transcript.segments.length > 0) { video.transcript.segments.forEach(segment => { content += `**${segment.timestamp}**\n`; content += `${segment.text}\n\n`; }); } else { // Show full transcript text content += video.transcript.fullText; } } // Code examples if (includeCode && video.codeExamples && video.codeExamples.length > 0) { content += '\n## Code Examples\n\n'; video.codeExamples.forEach((example, index) => { if (example.title) { content += `### ${example.title}`; } else { content += `### Code Example ${index + 1}`; } if (example.timestamp) { content += ` (${example.timestamp})`; } content += '\n\n'; content += `\`\`\`${example.language}\n`; content += example.code; content += '\n\`\`\`\n\n'; if (example.context) { content += `*${example.context}*\n\n`; } }); } // Related videos if (video.relatedVideos && video.relatedVideos.length > 0) { content += '\n## Related Videos\n\n'; video.relatedVideos.forEach(related => { content += `- [${related.title}](${related.url}) (WWDC${related.year})\n`; }); } return content; } - src/schemas/wwdc.schemas.ts:31-36 (schema)Zod schema for get_wwdc_video input: year (string), videoId (string), includeTranscript (boolean, default true), includeCode (boolean, default true).
export const getWWDCVideoSchema = z.object({ year: z.string().describe('WWDC year'), videoId: z.string().describe('Video ID'), includeTranscript: z.boolean().default(true).describe('Include transcript'), includeCode: z.boolean().default(true).describe('Include code examples'), }); - src/tools/definitions.ts:388-417 (registration)Tool definition/registration with name 'get_wwdc_video', description, inputSchema (type: object with year, videoId, includeTranscript, includeCode), and annotations.
{ name: 'get_wwdc_video', description: 'Access complete WWDC session content including full transcript, code examples, and resources. Use after finding videos with list_wwdc_videos or search_wwdc_content. Provides offline access to entire session content.', inputSchema: { type: 'object', properties: { year: { type: 'string', description: 'WWDC year. Example: "2025"', }, videoId: { type: 'string', description: 'Session ID. Example: "10101" for keynote, "238" for session 238.', }, includeTranscript: { type: 'boolean', description: 'Include full session transcript with timestamps. Default: true', }, includeCode: { type: 'boolean', description: 'Include all code examples from the session. Default: true', }, }, required: ['year', 'videoId'], }, annotations: { title: 'Get WWDC Video', readOnlyHint: true, }, }, - src/tools/handlers.ts:257-266 (registration)Handler registration in the toolHandlers map: validates args with getWWDCVideoSchema, calls handleGetWWDCVideo, returns formatted text content.
get_wwdc_video: async (args, _server) => { const validatedArgs = getWWDCVideoSchema.parse(args); const result = await handleGetWWDCVideo( validatedArgs.year, validatedArgs.videoId, validatedArgs.includeTranscript, validatedArgs.includeCode, ); return { content: [{ type: 'text', text: result }] }; },