On this page
get_device_state
Returns the latest known values for the attributes this connection may read. Each value carries observed_at (when the manufacturer observed it), received_at (when Reachthings last fetched it) and fresh. Values older than max_age_ms are re-read once from the connector; if that read fails the stored value is returned with fresh: false and a connector_error. Values are observations; to check a command's result use get_command_status.
Arguments
From list_devices.
Attribute ids to read (see the catalog). Defaults to every readable attribute of the device.
Values older than this are refreshed from the manufacturer. Default 60,000.
Returns
null when the device has never reported it.
Manufacturer observation time, last fetch time, and whether it is within max_age_ms.
When this call ran.
Present when a refresh failed (vehicle asleep, manufacturer rate limit, …): code, retryable.
Request
await client.callTool({
name: "get_device_state",
arguments: { device_id: "dev_8kq2", attributes: ["power", "current_temperature"], max_age_ms: 30000 }
});{
"device_id": "dev_8kq2",
"attributes": [
{ "attribute": "power", "value": "on", "source": "manufacturer_state", "observed_at": "2026-11-01T09:12:04.000Z", "received_at": "2026-11-01T09:12:05.210Z", "fresh": true },
{ "attribute": "current_temperature", "value": 23.5, "source": "manufacturer_state", "observed_at": "2026-11-01T09:12:04.000Z", "received_at": "2026-11-01T09:12:05.210Z", "fresh": true }
],
"checked_at": "2026-11-01T09:12:05.210Z"
}Errors
Errors before a command is created return isError: true with command_id: null. Problems after creation are a command status, not an error. Full list: Errors.
| Code | When | What to do |
|---|---|---|
| DEVICE_NOT_ACCESSIBLE | Unknown device, or not granted to this agent | Call list_devices; ask the user to grant access |
- DEVICE_NOT_ACCESSIBLE
- WhenUnknown device, or not granted to this agent
- What to doCall
list_devices; ask the user to grant access