Skip to main content
Glama

applyMaterial

Assign materials to 3D objects in Spline scenes by specifying scene, object, and material IDs to customize visual appearance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneIdYesScene ID
objectIdYesObject ID
materialIdYesMaterial ID

Implementation Reference

  • The async handler function for the 'applyMaterial' tool. It sends a POST request to apply the specified materialId to the objectId in the sceneId via the apiClient.
    async ({ sceneId, objectId, materialId }) => { try { await apiClient.request('POST', `/scenes/${sceneId}/objects/${objectId}/material`, { materialId }); return { content: [ { type: 'text', text: `Material ${materialId} applied to object ${objectId} successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error applying material: ${error.message}` } ], isError: true }; } }
  • Zod input schema defining parameters for the 'applyMaterial' tool: sceneId, objectId, and materialId.
    { sceneId: z.string().min(1).describe('Scene ID'), objectId: z.string().min(1).describe('Object ID'), materialId: z.string().min(1).describe('Material ID'), },
  • The server.tool registration call for the 'applyMaterial' tool, including schema and handler function.
    // Apply a material to an object server.tool( 'applyMaterial', { sceneId: z.string().min(1).describe('Scene ID'), objectId: z.string().min(1).describe('Object ID'), materialId: z.string().min(1).describe('Material ID'), }, async ({ sceneId, objectId, materialId }) => { try { await apiClient.request('POST', `/scenes/${sceneId}/objects/${objectId}/material`, { materialId }); return { content: [ { type: 'text', text: `Material ${materialId} applied to object ${objectId} successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error applying material: ${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