getStates
Retrieve scene states from Spline 3D design tool to access and manage different configurations of your 3D scenes for design workflows.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sceneId | Yes | Scene ID |
Implementation Reference
- src/tools/state-event-tools.js:16-38 (handler)The handler function that implements the core logic of the 'getStates' tool: fetches states for a given sceneId using apiClient and returns formatted JSON or error response.async ({ sceneId }) => { try { const states = await apiClient.getStates(sceneId); return { content: [ { type: 'text', text: JSON.stringify(states, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving states: ${error.message}` } ], isError: true }; } }
- src/tools/state-event-tools.js:13-15 (schema)Zod schema defining the input parameters for the 'getStates' tool (sceneId: non-empty string).{ sceneId: z.string().min(1).describe('Scene ID'), },
- src/tools/state-event-tools.js:11-39 (registration)The server.tool call that registers the 'getStates' tool, including its name, input schema, and handler function.server.tool( 'getStates', { sceneId: z.string().min(1).describe('Scene ID'), }, async ({ sceneId }) => { try { const states = await apiClient.getStates(sceneId); return { content: [ { type: 'text', text: JSON.stringify(states, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving states: ${error.message}` } ], isError: true }; } } );
- src/utils/api-client.js:153-155 (helper)Helper method in apiClient that performs the actual API request to retrieve states for a scene.async getStates(sceneId) { return this.request('GET', `/scenes/${sceneId}/states`); }