get_presentation_info
Retrieve detailed information about a Google Slides presentation using its unique ID to access presentation content and structure.
Instructions
Get information about a Google Slides presentation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| presentationId | Yes | The ID of the Google Slides presentation |
Implementation Reference
- src/index.ts:289-302 (handler)The main handler function for the 'get_presentation_info' tool. It calls the slidesService to get the presentation details and formats a text response with title, slide count, and page size.private async handleGetPresentationInfo(args: { presentationId: string; }): Promise<CallToolResult> { const info = await this.slidesService.getPresentationInfo(args.presentationId); return { content: [ { type: 'text', text: `Presentation: ${info.title}\nSlide count: ${info.slideCount}\nPage size: ${info.pageSize.width.magnitude} x ${info.pageSize.height.magnitude} ${info.pageSize.width.unit}`, }, ], }; }
- src/index.ts:110-123 (registration)Tool registration in the ListToolsRequestSchema handler, defining the name, description, and input schema for 'get_presentation_info'.{ name: 'get_presentation_info', description: 'Get information about a Google Slides presentation', inputSchema: { type: 'object', properties: { presentationId: { type: 'string', description: 'The ID of the Google Slides presentation', }, }, required: ['presentationId'], }, },
- src/index.ts:113-122 (schema)Input schema for the 'get_presentation_info' tool, specifying the required 'presentationId' parameter.inputSchema: { type: 'object', properties: { presentationId: { type: 'string', description: 'The ID of the Google Slides presentation', }, }, required: ['presentationId'], },
- src/slides.ts:210-228 (helper)Supporting utility method in GoogleSlidesService that interacts with the Google Slides API to retrieve presentation information including title, slide count, and page size.async getPresentationInfo(presentationId: string) { await this.auth.refreshTokenIfNeeded(); const slides = this.auth.getSlidesClient(); try { const response = await slides.presentations.get({ presentationId }); return { title: response.data.title, slideCount: response.data.slides?.length || 0, pageSize: response.data.pageSize }; } catch (error) { console.error('Error getting presentation info:', error); throw new Error(`Failed to get presentation info: ${error}`); } }