Skip to main content
Glama

configureSoundAction

Configure sound actions in 3D scenes by setting audio files, volume levels, looping behavior, and spatial positioning for immersive audio experiences.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneIdYesScene ID
actionIdYesAction ID
soundUrlYesURL to sound file
volumeNoVolume (0-1)
loopNoWhether to loop the sound
spatialNoWhether sound is spatial (3D)
objectIdNoObject ID for spatial sound source

Implementation Reference

  • Registration of the 'configureSoundAction' tool on the MCP server, including schema validation and handler function.
    server.tool( 'configureSoundAction', { sceneId: z.string().min(1).describe('Scene ID'), actionId: z.string().min(1).describe('Action ID'), soundUrl: z.string().url().describe('URL to sound file'), volume: z.number().min(0).max(1).optional().default(1).describe('Volume (0-1)'), loop: z.boolean().optional().default(false).describe('Whether to loop the sound'), spatial: z.boolean().optional().default(false).describe('Whether sound is spatial (3D)'), objectId: z.string().optional().describe('Object ID for spatial sound source'), }, async ({ sceneId, actionId, soundUrl, volume, loop, spatial, objectId }) => { try { const parameters = { soundUrl, volume, loop, spatial, ...(spatial && objectId && { objectId }), }; await apiClient.request('PUT', `/scenes/${sceneId}/actions/${actionId}`, { type: 'sound', parameters }); return { content: [ { type: 'text', text: `Sound action ${actionId} configured successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error configuring sound action: ${error.message}` } ], isError: true }; } } );
  • Executes the configuration of a sound action by updating the action parameters via API call to the Spline server.
    async ({ sceneId, actionId, soundUrl, volume, loop, spatial, objectId }) => { try { const parameters = { soundUrl, volume, loop, spatial, ...(spatial && objectId && { objectId }), }; await apiClient.request('PUT', `/scenes/${sceneId}/actions/${actionId}`, { type: 'sound', parameters }); return { content: [ { type: 'text', text: `Sound action ${actionId} configured successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error configuring sound action: ${error.message}` } ], isError: true }; }
  • Zod schema for input validation of configureSoundAction parameters.
    { sceneId: z.string().min(1).describe('Scene ID'), actionId: z.string().min(1).describe('Action ID'), soundUrl: z.string().url().describe('URL to sound file'), volume: z.number().min(0).max(1).optional().default(1).describe('Volume (0-1)'), loop: z.boolean().optional().default(false).describe('Whether to loop the sound'), spatial: z.boolean().optional().default(false).describe('Whether sound is spatial (3D)'), objectId: z.string().optional().describe('Object ID for spatial sound source'), },
  • src/index.js:95-95 (registration)
    Top-level registration call that invokes registerActionTools on the main MCP server instance, which includes configureSoundAction.
    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