aia_add_component
Add a UI component to a screen in an App Inventor project, optionally nesting it inside a parent component. Specify type, name, and position to build the interface programmatically.
Instructions
Add a UI component to a screen, optionally nested inside a parent arrangement/component
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"screen_name": "<screen_name>",
"type": "<type>",
"name": "<name>"
},
"name": "aia_add_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Unique component name | |
| path | Yes | Absolute or relative path to an .aia file | |
| type | Yes | App Inventor component type, e.g. Button, Label, HorizontalArrangement, Canvas | |
| props_json | No | Extra properties as JSON object string, e.g. '{"Text":"Click me"}' | |
| parent_name | No | Nest inside this existing component instead of the screen root | |
| screen_name | Yes |