create_object
Generate a new Roblox object instance by specifying its class name and parent path, enabling efficient creation of basic objects within Roblox Studio.
Instructions
Create a new Roblox object instance (basic, without properties)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| className | Yes | Roblox class name (e.g., "Part", "Script", "Folder") | |
| name | No | Optional name for the new object | |
| parent | Yes | Path to the parent instance (e.g., "game.Workspace") |
Input Schema (JSON Schema)
{
"properties": {
"className": {
"description": "Roblox class name (e.g., \"Part\", \"Script\", \"Folder\")",
"type": "string"
},
"name": {
"description": "Optional name for the new object",
"type": "string"
},
"parent": {
"description": "Path to the parent instance (e.g., \"game.Workspace\")",
"type": "string"
}
},
"required": [
"className",
"parent"
],
"type": "object"
}
Implementation Reference
- src/tools/index.ts:217-234 (handler)The core handler function that implements the 'create_object' MCP tool. Validates className and parent, sends HTTP request to Studio bridge API endpoint '/api/create-object', and returns formatted response.async createObject(className: string, parent: string, name?: string) { if (!className || !parent) { throw new Error('Class name and parent are required for create_object'); } const response = await this.client.request('/api/create-object', { className, parent, name }); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2) } ] }; }
- src/index.ts:290-310 (schema)The tool schema definition for 'create_object', including name, description, and input schema specifying required className and parent parameters.name: 'create_object', description: 'Create a new Roblox object instance (basic, without properties)', inputSchema: { type: 'object', properties: { className: { type: 'string', description: 'Roblox class name (e.g., "Part", "Script", "Folder")' }, parent: { type: 'string', description: 'Path to the parent instance (e.g., "game.Workspace")' }, name: { type: 'string', description: 'Optional name for the new object' } }, required: ['className', 'parent'] } },
- src/index.ts:686-687 (registration)The dispatch/registration in the CallToolRequestSchema handler that routes 'create_object' calls to the tools.createObject method.case 'create_object': return await this.tools.createObject((args as any)?.className as string, (args as any)?.parent as string, (args as any)?.name);