Skip to main content
Glama
aydinfer
by aydinfer

createObject

Add 3D objects like cubes, spheres, cylinders, and lights to Spline scenes with custom positioning, rotation, and scaling for 3D design projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneIdYesScene ID
typeYesObject type
nameYesObject name
positionNoObject position
rotationNoObject rotation
scaleNoObject scale
colorNoObject color (hex)
propertiesNoAdditional properties

Implementation Reference

  • The MCP tool handler for 'createObject' that constructs the object data from parameters and calls the API client to create the object in the scene, returning success or error response.
    async ({ sceneId, type, name, position, rotation, scale, color, properties }) => {
      try {
        const objectData = {
          type,
          name,
          position: position || { x: 0, y: 0, z: 0 },
          rotation: rotation || { x: 0, y: 0, z: 0 },
          scale: scale || { x: 1, y: 1, z: 1 },
          ...(color && { color }),
          ...(properties && { properties }),
        };
        
        const result = await apiClient.createObject(sceneId, objectData);
        
        return {
          content: [
            { 
              type: 'text', 
              text: `Object created successfully with ID: ${result.id}` 
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            { 
              type: 'text', 
              text: `Error creating object: ${error.message}` 
            }
          ],
          isError: true
        };
      }
  • Zod schema defining the input parameters for the createObject tool, including sceneId, type, name, position, rotation, scale, color, and properties.
    {
      sceneId: z.string().min(1).describe('Scene ID'),
      type: z.enum([
        'cube', 'sphere', 'cylinder', 'cone', 'torus', 
        'plane', 'text', 'image', 'group', 'light'
      ]).describe('Object type'),
      name: z.string().min(1).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'),
      rotation: z.object({
        x: z.number().default(0).describe('X rotation (degrees)'),
        y: z.number().default(0).describe('Y rotation (degrees)'),
        z: z.number().default(0).describe('Z rotation (degrees)'),
      }).optional().describe('Object rotation'),
      scale: z.object({
        x: z.number().default(1).describe('X scale'),
        y: z.number().default(1).describe('Y scale'),
        z: z.number().default(1).describe('Z scale'),
      }).optional().describe('Object scale'),
      color: z.string().optional().describe('Object color (hex)'),
      properties: z.record(z.any()).optional().describe('Additional properties'),
    },
  • The server.tool call that registers the 'createObject' MCP tool with its schema and handler within the registerObjectTools function.
    server.tool(
      'createObject',
      {
        sceneId: z.string().min(1).describe('Scene ID'),
        type: z.enum([
          'cube', 'sphere', 'cylinder', 'cone', 'torus', 
          'plane', 'text', 'image', 'group', 'light'
        ]).describe('Object type'),
        name: z.string().min(1).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'),
        rotation: z.object({
          x: z.number().default(0).describe('X rotation (degrees)'),
          y: z.number().default(0).describe('Y rotation (degrees)'),
          z: z.number().default(0).describe('Z rotation (degrees)'),
        }).optional().describe('Object rotation'),
        scale: z.object({
          x: z.number().default(1).describe('X scale'),
          y: z.number().default(1).describe('Y scale'),
          z: z.number().default(1).describe('Z scale'),
        }).optional().describe('Object scale'),
        color: z.string().optional().describe('Object color (hex)'),
        properties: z.record(z.any()).optional().describe('Additional properties'),
      },
      async ({ sceneId, type, name, position, rotation, scale, color, properties }) => {
        try {
          const objectData = {
            type,
            name,
            position: position || { x: 0, y: 0, z: 0 },
            rotation: rotation || { x: 0, y: 0, z: 0 },
            scale: scale || { x: 1, y: 1, z: 1 },
            ...(color && { color }),
            ...(properties && { properties }),
          };
          
          const result = await apiClient.createObject(sceneId, objectData);
          
          return {
            content: [
              { 
                type: 'text', 
                text: `Object created successfully with ID: ${result.id}` 
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              { 
                type: 'text', 
                text: `Error creating object: ${error.message}` 
              }
            ],
            isError: true
          };
        }
      }
    );
  • src/index.js:88-88 (registration)
    Top-level registration call in the main server setup that invokes registerObjectTools(server), thereby registering the createObject tool.
    registerObjectTools(server);
  • Helper method in the API client that performs the actual HTTP POST request to the Spline.design API to create a new object.
    async createObject(sceneId, objectData) {
      return this.request('POST', `/scenes/${sceneId}/objects`, objectData);
    }
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