# entity.set_component

> Talos next · Since next

[editor or disk] Put this component on this entity, replacing any of its type, one undo step.

Fields are FLAT ({"type":"mesh","asset":"cube"}), not under play.query's "props"; only script has props.

| | |
|---|---|
| Title | Set a component |
| Mode |  |
| Token cost | about 160 tokens (in the default list, paid on every call) |
| Toolset | core |

## Arguments

| Argument | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
| `agent` | `string` | no |  |  | The name of the agent making the call, when several agents share one connection: each named agent is its own actor and plays its own game. Leave it out when there is one agent. |
| `component` | `object` | yes |  |  | {"type": mesh, collider, rigidbody, controller, camera, light, spawn, script, …, its fields} |
| `entity` | `string` | yes |  |  |  |
| `save` | `boolean` | no |  |  | `true` saves the scene afterwards. |
| `scene` | `string` | no |  |  | The scene file to act on. The open scene when absent. |

## Example

An MCP `tools/call` with the required arguments (placeholders in angle brackets).

```json
{
  "name": "entity.set_component",
  "arguments": {
    "component": {},
    "entity": "<entity>"
  }
}
```
