Flecs Get Component
flecs_get_componentRetrieve a single component's value from a FLECS entity. Returns the serialized value or an error if the component is missing or a tag.
Instructions
[READ] Get the value of a single component of an entity.
Returns {entity, component, value}; 'value' is the component serialized by FLECS reflection (usually an object of members, e.g. {"x": 10, "y": 20}). Errors when the entity does not have the component, when the id is a tag (no data) or when it cannot be resolved.
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": {
"entity": "<entity>",
"component": "<component>"
},
"name": "flecs_get_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity | Yes | Entity path in FLECS dotted notation, e.g. 'Sun.Earth' or 'flecs.core.World' (the 'parent' and 'name' fields of a query result joined with '.'), or a numeric entity id such as '#523'. Escape a literal '.' inside a name as '\.'. | |
| component | Yes | Component, tag or pair, written as FLECS prints it: a full path such as 'planets.Mass', or a pair such as '(flecs.core.ChildOf, Sun)'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | ||
| entity | Yes | ||
| component | Yes |