Skip to main content
Glama

configureVariableAction

Modify variables in Spline 3D scenes to control animations and interactions. Set, increment, decrement, multiply, divide, or toggle values to adjust scene behavior and dynamic elements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneIdYesScene ID
actionIdYesAction ID
variableNameYesVariable name
operationYesOperation to perform
valueNoValue to use in the operation

Implementation Reference

  • The handler function for the 'configureVariableAction' tool. It updates an existing action to type 'variableControl' with parameters for variable name, operation (set, increment, etc.), and value via a PUT request to the Spline API.
    async ({ sceneId, actionId, variableName, operation, value }) => { try { const parameters = { variableName, operation, value, }; await apiClient.request('PUT', `/scenes/${sceneId}/actions/${actionId}`, { type: 'variableControl', parameters }); return { content: [ { type: 'text', text: `Variable control action ${actionId} configured successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error configuring variable control action: ${error.message}` } ], isError: true }; }
  • Zod schema defining the input parameters for the 'configureVariableAction' tool: sceneId, actionId, variableName, operation, and value.
    { sceneId: z.string().min(1).describe('Scene ID'), actionId: z.string().min(1).describe('Action ID'), variableName: z.string().min(1).describe('Variable name'), operation: z.enum(['set', 'increment', 'decrement', 'multiply', 'divide', 'toggle']) .describe('Operation to perform'), value: z.any().describe('Value to use in the operation'), },
  • Registration of the 'configureVariableAction' tool using server.tool() within the registerActionTools function.
    'configureVariableAction', { sceneId: z.string().min(1).describe('Scene ID'), actionId: z.string().min(1).describe('Action ID'), variableName: z.string().min(1).describe('Variable name'), operation: z.enum(['set', 'increment', 'decrement', 'multiply', 'divide', 'toggle']) .describe('Operation to perform'), value: z.any().describe('Value to use in the operation'), }, async ({ sceneId, actionId, variableName, operation, value }) => { try { const parameters = { variableName, operation, value, }; await apiClient.request('PUT', `/scenes/${sceneId}/actions/${actionId}`, { type: 'variableControl', parameters }); return { content: [ { type: 'text', text: `Variable control action ${actionId} configured successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error configuring variable control action: ${error.message}` } ], isError: true }; } } );
  • src/index.js:95-95 (registration)
    High-level registration call to registerActionTools(server) in the main server setup, which includes the configureVariableAction tool.
    registerActionTools(server);

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