Skip to main content
Glama

create3DText

Generate 3D text objects in Spline scenes with customizable fonts, sizes, colors, and extrusion depth for 3D design projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneIdYesScene ID
textYesText content
nameNoObject name
positionNoObject position
fontNoFont familyInter
sizeNoFont size
extrusionNoExtrusion depth
colorNoText color (hex)#ffffff

Implementation Reference

  • Registration of the create3DText tool including inline schema and handler
    server.tool( "create3DText", { sceneId: z.string().min(1).describe("Scene ID"), text: z.string().min(1).describe("Text content"), font: z.string().optional().describe("Font name"), size: z.number().positive().default(1).describe("Text size"), depth: z.number().positive().default(0.2).describe("Extrusion depth for 3D"), position: z.object({ x: z.number().default(0), y: z.number().default(0), z: z.number().default(0), }).optional().describe("Position in 3D space"), alignment: z.enum(["left", "center", "right"]).default("left").describe("Text alignment"), material: z.string().optional().describe("Material ID to apply"), is3D: z.boolean().default(true).describe("Create 3D extruded text or flat 2D text"), }, async ({ sceneId, text, font, size, depth, position, alignment, material, is3D }) => { try { const result = await fetchFromSplineApi(`/scenes/${sceneId}/objects/text`, { method: "POST", body: JSON.stringify({ text, font, size, depth, position, alignment, material, is3D, }), }); return { content: [{ type: "text", text: `Created ${is3D ? '3D' : '2D'} text object (ID: ${result.objectId})` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating text object: ${error.message}` }], isError: true }; } } );
  • Handler function that performs the actual API call to create the 3D text object in the Spline scene
    async ({ sceneId, text, font, size, depth, position, alignment, material, is3D }) => { try { const result = await fetchFromSplineApi(`/scenes/${sceneId}/objects/text`, { method: "POST", body: JSON.stringify({ text, font, size, depth, position, alignment, material, is3D, }), }); return { content: [{ type: "text", text: `Created ${is3D ? '3D' : '2D'} text object (ID: ${result.objectId})` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating text object: ${error.message}` }], isError: true }; } }
  • Input schema validation using Zod for the create3DText tool parameters
    { sceneId: z.string().min(1).describe("Scene ID"), text: z.string().min(1).describe("Text content"), font: z.string().optional().describe("Font name"), size: z.number().positive().default(1).describe("Text size"), depth: z.number().positive().default(0.2).describe("Extrusion depth for 3D"), position: z.object({ x: z.number().default(0), y: z.number().default(0), z: z.number().default(0), }).optional().describe("Position in 3D space"), alignment: z.enum(["left", "center", "right"]).default("left").describe("Text alignment"), material: z.string().optional().describe("Material ID to apply"), is3D: z.boolean().default(true).describe("Create 3D extruded text or flat 2D text"), },
  • Alternative/stub registration of create3DText in design-tools (dummy implementation)
    server.tool( 'create3DText', { sceneId: z.string().min(1).describe('Scene ID'), text: z.string().min(1).describe('Text content'), name: z.string().optional().describe('Object name'), position: z.object({ x: z.number().default(0).describe('X position'), y: z.number().default(0).describe('Y position'), z: z.number().default(0).describe('Z position'), }).optional().describe('Object position'), font: z.string().optional().default('Inter').describe('Font family'), size: z.number().min(0).optional().default(1).describe('Font size'), extrusion: z.number().min(0).optional().default(0.2).describe('Extrusion depth'), color: z.string().optional().default('#ffffff').describe('Text color (hex)'), }, async ({ sceneId, text, name, position, font, size, extrusion, color }) => { try { // This would normally call the Spline API to create 3D text // For now, just return a success message return { content: [ { type: 'text', text: `3D text "${text}" created successfully` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error creating 3D text: ${error.message}` } ], isError: true }; } } );
  • Imports helper functions for API calls used in the handler
    import { fetchFromSplineApi, updateSplineObject } from "../../utils/api-client.js";

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