Skip to main content
Glama

Flecs Get Component

flecs_get_component
Read-onlyIdempotent

Retrieve 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityYesEntity 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 '\.'.
componentYesComponent, 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

TableJSON Schema
NameRequiredDescriptionDefault
valueYes
entityYes
componentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), but the description adds real behavioral context: the return shape {entity, component, value}, the fact that value is reflection-serialized (usually a member object like {"x":10,"y":20}), and the three error conditions. That is more than the annotations convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences, front-loaded with the purpose, then the return contract, then failure modes. No filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the return-value explanation is technically redundant, but the note about FLECS reflection serialization adds nuance the schema likely cannot express. Combined with documented error conditions, the definition is complete enough, with only the sibling-differentiation gap remaining.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the dotted-entity-path and component/pair syntaxes are already fully documented in the schema. The description adds no additional parameter meaning, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Get the value of a single component of an entity') and the '[READ]' prefix signals the operation class. It does not, however, distinguish itself from the sibling flecs_get_entity, which an agent might reasonably pick instead when it wants a component's value.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the 'single component' scoping and the error cases (missing component, tag with no data, unresolvable id), which hint at when the call will fail. There is no explicit guidance on when to prefer this over flecs_get_entity or flecs_query.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.