Skip to main content
Glama

configureApiRequestAction

Configure API request actions in Spline 3D scenes to map response data to scene variables for dynamic content integration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneIdYesScene ID
actionIdYesAction ID
apiIdYesAPI configuration ID
mappingsNoResponse mappings

Implementation Reference

  • Handler function that updates the API request action configuration by sending a PUT request to the API with the provided apiId and optional mappings.
    async ({ sceneId, actionId, apiId, mappings }) => { try { const parameters = { apiId, ...(mappings && { mappings }), }; await apiClient.request('PUT', `/scenes/${sceneId}/actions/${actionId}`, { type: 'apiRequest', parameters }); return { content: [ { type: 'text', text: `API request action ${actionId} configured successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error configuring API request action: ${error.message}` } ], isError: true }; }
  • Zod schema defining the input parameters: sceneId, actionId, apiId, and optional mappings for response fields to variables.
    sceneId: z.string().min(1).describe('Scene ID'), actionId: z.string().min(1).describe('Action ID'), apiId: z.string().min(1).describe('API configuration ID'), mappings: z.array(z.object({ responseField: z.string().describe('Field from API response'), variableName: z.string().describe('Spline variable name'), variableType: z.enum(['string', 'number', 'boolean']).describe('Variable type'), })).optional().describe('Response mappings'), },
  • Registration of the 'configureApiRequestAction' tool using server.tool(), including schema and handler.
    'configureApiRequestAction', { sceneId: z.string().min(1).describe('Scene ID'), actionId: z.string().min(1).describe('Action ID'), apiId: z.string().min(1).describe('API configuration ID'), mappings: z.array(z.object({ responseField: z.string().describe('Field from API response'), variableName: z.string().describe('Spline variable name'), variableType: z.enum(['string', 'number', 'boolean']).describe('Variable type'), })).optional().describe('Response mappings'), }, async ({ sceneId, actionId, apiId, mappings }) => { try { const parameters = { apiId, ...(mappings && { mappings }), }; await apiClient.request('PUT', `/scenes/${sceneId}/actions/${actionId}`, { type: 'apiRequest', parameters }); return { content: [ { type: 'text', text: `API request action ${actionId} configured successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error configuring API request action: ${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