Eclipse Ditto

v0.1.1
io.github.nagarjunr/eclipse-ditto Checked 11 hours ago Published 4 months ago

MCP server for the Eclipse Ditto digital twin HTTP API (things, policies, connections, more).

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_things List Things

Search/list digital twins (things) registered in Ditto. Wraps GET /api/2/search/things.

ParameterTypeDescription
fieldsOptional list of field selectors to project the response (e.g. ['thingId', 'attributes']).
filterDitto RQL filter expression, e.g. eq(attributes/location,"lab-1") or gt(features/temperature/properties/value,20).
limitintegerMaximum number of things to return.
namespacesRestrict the search to these namespaces (e.g. ['org.eclipse.ditto']). Omit to search all.

count_things Count Things

Count things matching a search filter, without fetching them. Wraps GET /api/2/search/things/count.

ParameterTypeDescription
filterDitto RQL filter expression.
namespacesRestrict the count to these namespaces.

get_things Get Things

Bulk-fetch multiple things by ID in one request. Wraps GET /api/2/things?ids=...

ParameterTypeDescription
thing_ids *arrayThing IDs to fetch in a single request.
fieldsOptional list of field selectors to project the response (e.g. ['thingId', 'attributes']).

get_thing Get Thing

Fetch the full digital twin (attributes and features) for a thing. Wraps GET /api/2/things/{thingId}.

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
fieldsOptional list of field selectors to project the response (e.g. ['thingId', 'attributes']).

put_thing Put Thing

Create a new thing, or replace an existing one (with overwrite=True). Wraps PUT /api/2/things/{thingId}. Uses If-None-Match to make the create-only (overwrite=False) path race-free rather than check-then-set.

ParameterTypeDescription
thing *objectFull thing JSON (attributes, features, definition, policyId).
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
overwritebooleanIf False (default), fails if the resource already exists. Set True to replace it.

patch_thing Patch Thing

Partially update a thing (creates it if it doesn't exist yet). Wraps PATCH /api/2/things/{thingId} with Content-Type: application/merge-patch+json.

ParameterTypeDescription
patch *objectRFC-7396 JSON Merge Patch document. A null value deletes that key from the thing.
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

delete_thing Delete Thing

Delete a thing. Wraps DELETE /api/2/things/{thingId}. Irreversible.

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.

get_thing_policy_id Get Thing Policy Id

Get the policy ID controlling access to a thing. Wraps GET /things/{thingId}/policyId.

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

set_thing_policy_id Set Thing Policy Id

Repoint a thing at a different policy. Wraps PUT /things/{thingId}/policyId.

ParameterTypeDescription
policy_id *stringPolicy ID to attach to this thing.
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

get_thing_definition Get Thing Definition

Get a thing's definition (WoT model reference). Wraps GET /things/{thingId}/definition.

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

set_thing_definition Set Thing Definition

Set a thing's definition. Wraps PUT /things/{thingId}/definition.

ParameterTypeDescription
definition *stringDefinition identifier, e.g. 'com.acme:coffeebrewer:0.1.0'.
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

delete_thing_definition Delete Thing Definition

Remove a thing's definition. Wraps DELETE /things/{thingId}/definition.

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.

whoami Whoami

Return the identity Ditto has authenticated this connector as. Wraps GET /api/2/whoami. Useful to sanity-check DITTO_USERNAME/DITTO_PASSWORD/DITTO_BEARER_TOKEN configuration.

get_thing_attributes Get Thing Attributes

Get a thing's attributes, or one attribute by JSON pointer path. Wraps GET /things/{thingId}/attributes[/{path}].

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
pathOptional RFC-6901 JSON pointer path within the resource (e.g. 'configuration/brewingTemp'). Omit to target the whole resource.

set_thing_attributes Set Thing Attributes

Set a thing's whole attributes object, or one attribute by path. Wraps PUT /things/{thingId}/attributes[/{path}].

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
value *Value to set. A JSON object if path is omitted, any JSON value otherwise.
overwritebooleanIf False (default), fails if the resource already exists. Set True to replace it.
pathOptional RFC-6901 JSON pointer path within the resource (e.g. 'configuration/brewingTemp'). Omit to target the whole resource.

delete_thing_attributes Delete Thing Attributes

Delete a thing's whole attributes object, or one attribute by path. Wraps DELETE /things/{thingId}/attributes[/{path}].

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.
pathOptional RFC-6901 JSON pointer path within the resource (e.g. 'configuration/brewingTemp'). Omit to target the whole resource.

get_thing_features Get Thing Features

Fetch only the feature state (sensor/actuator data) for a thing. Wraps GET /api/2/things/{thingId}/features. Ditto returns 404 both when the thing doesn't exist and when it exists but has no features defined; both cases are normalized here to an empty dict.

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

get_feature Get Feature

Fetch a single feature (definition + properties + desiredProperties). Wraps GET /things/{thingId}/features/{featureId}.

ParameterTypeDescription
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

put_feature Put Feature

Create or replace a whole feature. Wraps PUT /things/{thingId}/features/{featureId}.

ParameterTypeDescription
feature *objectFull feature JSON (definition, properties).
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
overwritebooleanIf False (default), fails if the resource already exists. Set True to replace it.

delete_feature Delete Feature

Delete a whole feature. Wraps DELETE /things/{thingId}/features/{featureId}.

ParameterTypeDescription
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.

get_feature_properties Get Feature Properties

Get a feature's properties (or desiredProperties), or one property by path. Wraps GET /things/{thingId}/features/{featureId}/(desired)properties[/{path}].

ParameterTypeDescription
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
desiredbooleanRead desiredProperties instead of properties.
pathOptional RFC-6901 JSON pointer path within the resource (e.g. 'configuration/brewingTemp'). Omit to target the whole resource.

set_feature_properties Set Feature Properties

Set a feature's whole properties (or desiredProperties) object, or one property by path. Wraps PUT /things/{thingId}/features/{featureId}/(desired)properties[/{path}].

ParameterTypeDescription
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
value *Value to set. A JSON object if path is omitted, any JSON value otherwise.
desiredbooleanWrite desiredProperties instead of properties.
overwritebooleanIf False (default), fails if the resource already exists. Set True to replace it.
pathOptional RFC-6901 JSON pointer path within the resource (e.g. 'configuration/brewingTemp'). Omit to target the whole resource.

delete_feature_properties Delete Feature Properties

Delete a feature's whole properties (or desiredProperties) object, or one property by path. Wraps DELETE /things/{thingId}/features/{featureId}/(desired)properties[/{path}].

ParameterTypeDescription
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.
desiredbooleanDelete from desiredProperties instead of properties.
pathOptional RFC-6901 JSON pointer path within the resource (e.g. 'configuration/brewingTemp'). Omit to target the whole resource.

get_feature_definition Get Feature Definition

Get a feature's definition. Wraps GET .../features/{featureId}/definition.

ParameterTypeDescription
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

set_feature_definition Set Feature Definition

Set a feature's definition. Wraps PUT .../features/{featureId}/definition.

ParameterTypeDescription
definition *arrayList of definition identifiers, e.g. ['com.acme:coffeebrewer:0.1.0'].
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').

delete_feature_definition Delete Feature Definition

Remove a feature's definition. Wraps DELETE .../features/{featureId}/definition.

ParameterTypeDescription
feature_id *stringFeature ID within the thing (e.g. 'temperature').
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.

send_message Send Message

Send a live message to (or from) a thing or one of its features. Wraps POST /things/{thingId}/[features/{featureId}/]{direction}/messages/{subject}.

ParameterTypeDescription
payload *Message payload. Sent as JSON.
subject *stringMessage subject, e.g. 'makeCoffee'.
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
directionstring'inbox' sends TO the thing/feature, 'outbox' FROM it.
feature_idScope the message to this feature instead of the whole thing.
timeoutintegerSeconds to wait for a response. 0 sends fire-and-forget.

claim_thing Claim Thing

Send a claim message to gain access to a thing. Wraps POST /things/{thingId}/inbox/claim.

ParameterTypeDescription
thing_id *stringDitto thing ID in the form 'namespace:name' (e.g. 'org.eclipse.ditto:my-thing').
payloadOptional claim payload sent to the thing's registered handler.
timeoutintegerSeconds to wait for a response.

get_policy Get Policy

Fetch a policy. Wraps GET /api/2/policies/{policyId}.

ParameterTypeDescription
policy_id *stringDitto policy ID in the form 'namespace:name'.

put_policy Put Policy

Create a new policy, or replace an existing one (with overwrite=True). Wraps PUT /api/2/policies/{policyId}.

ParameterTypeDescription
policy *objectFull policy JSON (entries with subjects/resources).
policy_id *stringDitto policy ID in the form 'namespace:name'.
overwritebooleanIf False (default), fails if the resource already exists. Set True to replace it.

delete_policy Delete Policy

Delete a policy. Wraps DELETE /api/2/policies/{policyId}. Irreversible. Note: things still referencing this policy will become inaccessible.

ParameterTypeDescription
policy_id *stringDitto policy ID in the form 'namespace:name'.
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.

get_policy_entries Get Policy Entries

Get all policy entries, or one entry by label. Wraps GET /policies/{policyId}/entries[/{label}].

ParameterTypeDescription
policy_id *stringDitto policy ID in the form 'namespace:name'.
labelSpecific entry label to fetch. Omit to fetch all entries.

set_policy_entry Set Policy Entry

Create or replace one policy entry. Wraps PUT /policies/{policyId}/entries/{label}.

ParameterTypeDescription
entry *objectPolicy entry JSON: {'subjects': {...}, 'resources': {...}}.
label *stringEntry label, e.g. 'DEFAULT' or 'DEVICES'.
policy_id *stringDitto policy ID in the form 'namespace:name'.
overwritebooleanIf False (default), fails if the resource already exists. Set True to replace it.

delete_policy_entry Delete Policy Entry

Delete one policy entry. Wraps DELETE /policies/{policyId}/entries/{label}.

ParameterTypeDescription
label *stringEntry label to delete.
policy_id *stringDitto policy ID in the form 'namespace:name'.
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.

list_connections List Connections

List all configured connections. Wraps GET /api/2/connections. Requires devops credentials.

ParameterTypeDescription
ids_onlybooleanReturn only connection IDs, not full configs.

get_connection Get Connection

Fetch a connection's config. Wraps GET /api/2/connections/{connectionId}. Requires devops credentials.

ParameterTypeDescription
connection_id *stringDitto connection ID.

create_connection Create Connection

Create a new connection; its ID is generated by Ditto. Wraps POST /api/2/connections. Requires devops credentials.

ParameterTypeDescription
connection *objectNew connection JSON (connectionType, connectionStatus, sources, targets, ...).
dry_runbooleanIf True, only test connectivity without persisting the connection.

update_connection Update Connection

Update an existing connection's config. Wraps PUT /api/2/connections/{connectionId}. Unlike thing/policy PUT, this only updates — Ditto returns 404 if the connection doesn't already exist. Requires devops credentials.

ParameterTypeDescription
connection *objectFull replacement connection JSON.
connection_id *stringDitto connection ID.

delete_connection Delete Connection

Delete a connection. Wraps DELETE /api/2/connections/{connectionId}. Irreversible. Requires devops credentials.

ParameterTypeDescription
connection_id *stringDitto connection ID.
confirmbooleanMust be explicitly set to True to perform this delete. Safety gate against accidental destructive calls.

get_connection_status Get Connection Status

Get a connection's live status. Wraps GET /connections/{connectionId}/status. Requires devops credentials.

ParameterTypeDescription
connection_id *stringDitto connection ID.

get_connection_metrics Get Connection Metrics

Get a connection's metrics. Wraps GET /connections/{connectionId}/metrics. Requires devops credentials.

ParameterTypeDescription
connection_id *stringDitto connection ID.

get_connection_logs Get Connection Logs

Get a connection's logs. Wraps GET /connections/{connectionId}/logs. Logging must first be enabled via send_connection_command(connection_id, "connectivity.commands:enableConnectionLogs") — it's on by default when a connection is created or opened. Requires devops credentials.

ParameterTypeDescription
connection_id *stringDitto connection ID.

send_connection_command Send Connection Command

Send a lifecycle/diagnostic command to a connection. Wraps POST /connections/{connectionId}/command. Requires devops credentials.

ParameterTypeDescription
command *stringOne of: connectivity.commands:openConnection, connectivity.commands:closeConnection, connectivity.commands:resetConnectionMetrics, connectivity.commands:enableConnectionLogs, connectivity.commands:res…
connection_id *stringDitto connection ID.

get_logging_config Get Logging Config

Get currently configured log levels. Wraps GET /devops/logging[/{moduleName}]. Requires devops credentials.

ParameterTypeDescription
module_nameSpecific service module (e.g. 'gateway'). Omit for all.

set_logging_config Set Logging Config

Set a log level for a logger. Wraps PUT /devops/logging[/{moduleName}]. Requires devops credentials.

ParameterTypeDescription
level *stringLog level, e.g. 'INFO', 'DEBUG', 'WARN', 'ERROR'.
logger *stringLogger/package name, e.g. 'org.eclipse.ditto'.
module_nameRestrict the change to this service module. Omit for all.

get_devops_config Get Devops Config

Get cluster-wide runtime configuration. Wraps GET /devops/config?path=... Requires devops credentials.

ParameterTypeDescription
pathDotted config path to retrieve, e.g. 'ditto.gateway.authentication'. Strongly recommended to avoid a huge response.

send_devops_piggyback Send Devops Piggyback

Send a low-level admin (piggyback) command to the Ditto cluster. Wraps POST /devops/piggyback[/{serviceName}[/{instanceIndex}]]. Requires devops credentials. This is Ditto's most powerful/least guarded admin API — use with care.

ParameterTypeDescription
command *objectPiggyback command body, see Ditto DevOps API docs for shapes.
instance_indexRestrict to this service instance. Requires service_name.
service_nameRestrict to this service (e.g. 'things'). Omit to broadcast.
timeoutSeconds to wait for a response.

poll_thing_changes Poll Thing Changes

Open a short-lived SSE connection and collect live thing-change events. Approximates Ditto's persistent-connection change feed (GET /api/2/things with Accept: text/event-stream) within a single request/response tool call. Each event is a partial update (only the changed portion of the thing). Ditto's SSE stream sends periodic empty `data:` keepalive lines even when nothing has changed; the deadline is checked on every line received (including keepalives), not just on real events, so this always returns within duration_seconds regardless of how quiet or chatty the stream is.

ParameterTypeDescription
duration_secondsnumberWall-clock cutoff: stop listening after this many seconds.
fieldsOptional list of field selectors to project the response (e.g. ['thingId', 'attributes']).
filterDitto RQL filter expression.
max_eventsintegerStop early once this many events are collected.
namespacesRestrict to these namespaces.
thing_idsRestrict to these thing IDs. Omit to watch all visible things.