get_instance_children
Retrieve child objects and their types from a specified parent instance in Roblox Studio, enabling efficient navigation and interaction with project structures.
Instructions
Get child objects and their types
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instancePath | Yes | Path to the parent instance |
Input Schema (JSON Schema)
{
"properties": {
"instancePath": {
"description": "Path to the parent instance",
"type": "string"
}
},
"required": [
"instancePath"
],
"type": "object"
}
Implementation Reference
- src/tools/index.ts:93-106 (handler)The core implementation of the get_instance_children tool handler. It validates the instancePath input, makes an HTTP request to the Studio bridge for instance children data, and returns a formatted MCP response with the JSON data.async getInstanceChildren(instancePath: string) { if (!instancePath) { throw new Error('Instance path is required for get_instance_children'); } const response = await this.client.request('/api/instance-children', { instancePath }); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2) } ] }; }
- src/index.ts:154-167 (registration)MCP tool registration entry defining the name, description, and input schema for get_instance_children. This is returned by the listTools MCP method.{ name: 'get_instance_children', description: 'Get child objects and their types', inputSchema: { type: 'object', properties: { instancePath: { type: 'string', description: 'Path to the parent instance' } }, required: ['instancePath'] } },
- src/index.ts:664-665 (registration)Dispatch handler in the MCP CallToolRequestSchema that routes calls to the getInstanceChildren tool method based on the tool name.case 'get_instance_children': return await this.tools.getInstanceChildren((args as any)?.instancePath as string);
- src/http-server.ts:195-202 (helper)HTTP proxy endpoint that exposes the get_instance_children tool via POST /mcp/get_instance_children for direct HTTP calls from the Studio plugin or other clients.app.post('/mcp/get_instance_children', async (req, res) => { try { const result = await tools.getInstanceChildren(req.body.instancePath); res.json(result); } catch (error) { res.status(500).json({ error: error instanceof Error ? error.message : 'Unknown error' }); } });