getScenes
Retrieve scenes from Spline 3D projects with pagination controls to access specific scenes for design workflows and scene management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | Project ID (optional) | |
| limit | No | Maximum number of scenes to retrieve | |
| offset | No | Pagination offset |
Implementation Reference
- src/tools/scene-tools.js:50-79 (handler)Handler function for the 'getScenes' tool. Fetches a list of scenes from the API using GET /scenes with optional projectId and pagination parameters (limit, offset). Returns JSON stringified scenes or error message.async ({ projectId, limit, offset }) => { try { const params = { limit, offset, ...(projectId && { projectId }), }; const scenes = await apiClient.request('GET', '/scenes', params); return { content: [ { type: 'text', text: JSON.stringify(scenes, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving scenes: ${error.message}` } ], isError: true }; } }
- src/tools/scene-tools.js:44-49 (schema)Input schema for 'getScenes' tool defined using Zod. Parameters: projectId (optional string), limit (number 1-100 default 10), offset (number >=0 default 0).{ projectId: z.string().min(1).optional().describe('Project ID (optional)'), limit: z.number().int().min(1).max(100).default(10) .describe('Maximum number of scenes to retrieve'), offset: z.number().int().min(0).default(0).describe('Pagination offset'), },
- src/tools/scene-tools.js:42-80 (registration)Registration of the 'getScenes' tool within the registerSceneTools function using server.tool(). Includes inline schema and handler.server.tool( 'getScenes', { projectId: z.string().min(1).optional().describe('Project ID (optional)'), limit: z.number().int().min(1).max(100).default(10) .describe('Maximum number of scenes to retrieve'), offset: z.number().int().min(0).default(0).describe('Pagination offset'), }, async ({ projectId, limit, offset }) => { try { const params = { limit, offset, ...(projectId && { projectId }), }; const scenes = await apiClient.request('GET', '/scenes', params); return { content: [ { type: 'text', text: JSON.stringify(scenes, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving scenes: ${error.message}` } ], isError: true }; } } );