Skip to main content
Glama
aydinfer
by aydinfer

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";
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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