Skip to main content
Glama

getMaterials

Retrieve material data from a Spline 3D scene using the scene ID to access and work with design elements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneIdYesScene ID

Implementation Reference

  • The handler function for the 'getMaterials' MCP tool. It fetches materials from the scene using apiClient.getMaterials(sceneId), stringifies them as JSON, and returns in MCP content format or an error message.
    async ({ sceneId }) => { try { const materials = await apiClient.getMaterials(sceneId); return { content: [ { type: 'text', text: JSON.stringify(materials, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving materials: ${error.message}` } ], isError: true }; } }
  • Input schema for the getMaterials tool, validating sceneId as a non-empty string.
    { sceneId: z.string().min(1).describe('Scene ID'), },
  • Registration of the 'getMaterials' tool on the MCP server within registerMaterialTools.
    server.tool( 'getMaterials', { sceneId: z.string().min(1).describe('Scene ID'), }, async ({ sceneId }) => { try { const materials = await apiClient.getMaterials(sceneId); return { content: [ { type: 'text', text: JSON.stringify(materials, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving materials: ${error.message}` } ], isError: true }; } } );
  • src/index.js:89-89 (registration)
    Top-level call to registerMaterialTools which includes the getMaterials tool registration.
    registerMaterialTools(server);
  • Supporting API client method that performs the actual HTTP GET request to retrieve materials from the Spline API.
    async getMaterials(sceneId) { return this.request('GET', `/scenes/${sceneId}/materials`); }

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