set_relative_property
Adjust properties of instances in Roblox Studio by performing mathematical operations like add, subtract, multiply, divide, or power on their current values, specified by paths and property names.
Instructions
Modify properties relative to their current values
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| component | No | Specific component for Vector3/UDim2 properties | |
| operation | Yes | Mathematical operation to perform | |
| paths | Yes | Array of instance paths to modify | |
| propertyName | Yes | Name of the property to modify | |
| value | Yes | Value to use in the operation |
Input Schema (JSON Schema)
{
"properties": {
"component": {
"description": "Specific component for Vector3/UDim2 properties",
"enum": [
"X",
"Y",
"Z"
],
"type": "string"
},
"operation": {
"description": "Mathematical operation to perform",
"enum": [
"add",
"multiply",
"divide",
"subtract",
"power"
],
"type": "string"
},
"paths": {
"description": "Array of instance paths to modify",
"items": {
"type": "string"
},
"type": "array"
},
"propertyName": {
"description": "Name of the property to modify",
"type": "string"
},
"value": {
"description": "Value to use in the operation"
}
},
"required": [
"paths",
"propertyName",
"operation",
"value"
],
"type": "object"
}
Implementation Reference
- src/tools/index.ts:387-412 (handler)The handler function that executes the set_relative_property tool. Validates parameters and sends HTTP request to the Studio bridge API endpoint '/api/set-relative-property'.async setRelativeProperty( paths: string[], propertyName: string, operation: 'add' | 'multiply' | 'divide' | 'subtract' | 'power', value: any, component?: 'X' | 'Y' | 'Z' // For Vector3/UDim2 properties ) { if (!paths || paths.length === 0 || !propertyName || !operation || value === undefined) { throw new Error('Paths, property name, operation, and value are required for set_relative_property'); } const response = await this.client.request('/api/set-relative-property', { paths, propertyName, operation, value, component }); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2) } ] }; }
- src/index.ts:574-604 (schema)Defines the tool schema including description, input parameters, types, and validation rules for set_relative_property.name: 'set_relative_property', description: 'Modify properties relative to their current values', inputSchema: { type: 'object', properties: { paths: { type: 'array', items: { type: 'string' }, description: 'Array of instance paths to modify' }, propertyName: { type: 'string', description: 'Name of the property to modify' }, operation: { type: 'string', enum: ['add', 'multiply', 'divide', 'subtract', 'power'], description: 'Mathematical operation to perform' }, value: { description: 'Value to use in the operation' }, component: { type: 'string', enum: ['X', 'Y', 'Z'], description: 'Specific component for Vector3/UDim2 properties' } }, required: ['paths', 'propertyName', 'operation', 'value'] } },
- src/index.ts:708-709 (registration)Registers the tool handler dispatch in the MCP CallToolRequestSchema switch statement, mapping the tool name to the RobloxStudioTools.setRelativeProperty method.case 'set_relative_property': return await this.tools.setRelativeProperty((args as any)?.paths as string[], (args as any)?.propertyName as string, (args as any)?.operation, (args as any)?.value, (args as any)?.component);