Skip to main content
Glama

getVariable

Retrieve specific variable values from Spline 3D scenes to access and use scene data in your design workflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneIdYesScene ID
variableNameYesVariable name

Implementation Reference

  • The handler function for the 'getVariable' tool. It fetches all variables from the scene via the API, finds the one matching the variableName, and returns its details as JSON or an error if not found.
    async ({ sceneId, variableName }) => { try { const variables = await apiClient.request('GET', `/scenes/${sceneId}/variables`); const variable = variables.find(v => v.name === variableName); if (!variable) { return { content: [ { type: 'text', text: `Variable "${variableName}" not found` } ], isError: true }; } return { content: [ { type: 'text', text: JSON.stringify(variable, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving variable: ${error.message}` } ], isError: true }; }
  • Zod schema defining the input parameters for the 'getVariable' tool: sceneId (string) and variableName (string).
    { sceneId: z.string().min(1).describe('Scene ID'), variableName: z.string().min(1).describe('Variable name'), },
  • Registration of the 'getVariable' MCP tool using server.tool(), including schema and inline handler.
    server.tool( 'getVariable', { sceneId: z.string().min(1).describe('Scene ID'), variableName: z.string().min(1).describe('Variable name'), }, async ({ sceneId, variableName }) => { try { const variables = await apiClient.request('GET', `/scenes/${sceneId}/variables`); const variable = variables.find(v => v.name === variableName); if (!variable) { return { content: [ { type: 'text', text: `Variable "${variableName}" not found` } ], isError: true }; } return { content: [ { type: 'text', text: JSON.stringify(variable, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving variable: ${error.message}` } ], isError: true }; } } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aydinfer/spline-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server