Skip to content

MCP tools reference ​

This page lists every tool that an agent gets when it connects to Sensora over MCP. Use it to see what an agent can call, what each call changes, and what waits for a person.

The server in version 0.1.27 has 35 tools. An agent gets the same tools over HTTP and over stdio.

  • 24 tools only read.
  • 10 tools write.
  • 1 tool, enable_rule, always refuses and changes nothing.

Your MCP client receives the full description and the input schema of each tool with the tool list. The dashboard shows the names under Settings › MCP server › Tools. To connect a client, see Connect an agent.

Setup ​

ToolWhat it doesReads or writesApproval
get_startedReturns the ordered path from nothing to a live device with a checked alert, and which tool does each step.ReadsNone
get_firmwareReturns the firmware for a device: an Arduino sketch for sensora-library, the install lines for PlatformIO and the Arduino IDE, the ingest address, and the plain HTTP contract with a curl example.ReadsNone
await_first_readingWaits for a device's first stored reading, up to timeout_seconds (default 30, at most 45). On a timeout it says what the server saw and what to check, in order.ReadsNone

get_firmware takes device_uid and board (esp32, esp32s3 or esp32c3), and optionally secret, sensor and instance_url. The result has a case:

  • library_autodetect: the board is an ESP32, ESP32-S3 or ESP32-C3 and the sensor is one the library reads itself (BME280, BMP280, SHT4x, SHT3x, AHT20, BH1750, SCD4x, DS18B20). The sketch is complete.
  • own_sensor_code: anything else. The sketch connects the board and marks the place for your own sensor code. For a board that is not one of the three, there is no sketch and the result is the HTTP contract only.

If you pass secret, the tool checks it against the device before you flash. Simulated readings do not count for await_first_reading.

Devices ​

ToolWhat it doesReads or writesApproval
list_devicesLists all devices with status, battery, alert, site, template and integration.ReadsNone
get_deviceReturns one device and its latest value for each metric.ReadsNone
create_deviceRegisters a device and returns its device_uid and its secret. The secret is shown once.WritesNone
update_deviceEdits a device's name, site (zone), template, integration and external id. Only the fields you pass change.WritesNone
simulate_telemetrySends 1 to 500 simulated readings for a device through the same path as real readings. They are stored and labelled as simulated.WritesNone

Rules that are on also run on simulated readings. A rule with a notify or webhook step sends a real message when an agent simulates a reading that matches it.

Templates ​

ToolWhat it doesReads or writesApproval
list_templatesLists the device templates with the number of devices that use each one.ReadsNone
get_templateReturns one template with its property and attribute mappings.ReadsNone
create_templateCreates a template that maps payload fields to typed properties.WritesNone
search_template_librarySearches the built-in template library by vendor, model or slug.ReadsNone
import_library_templateImports a library template into the project as a copy you can edit. Importing the same one again returns the existing copy.WritesNone

Integrations and inbox ​

ToolWhat it doesReads or writesApproval
list_integrationsLists the webhook and MQTT integrations with device counts, inbox totals and endpoints.ReadsNone
get_integrationReturns one integration with its endpoint, auto-provision settings and inbox totals.ReadsNone
create_integrationCreates a webhook or MQTT integration. A webhook integration gets its own address with a token.WritesNone
list_inboxLists inbox entries: what an integration received and how each entry was processed.ReadsNone
replay_inbox_itemRuns a held inbox entry through the pipeline again, for example after the missing device or template was created.WritesNone

list_integrations and get_integration return the address of each webhook integration with its token. Every agent that can call these tools can read the address that accepts data for that integration. The signing secret of a webhook integration and the password of an MQTT integration are not returned.

Rules ​

ToolWhat it doesReads or writesApproval
list_rulesLists all rules with their state and graph. pending_approval and proposal show what waits for a person.ReadsNone
get_ruleReturns one rule with its graph, its stored backtest, its approval, an open proposal with a diff, and its health.ReadsNone
create_ruleSaves a new rule from a graph. The rule is saved paused and tagged as created by an agent. enabled is ignored. Sensora backtests it over the last 7 days and stores the result.WritesA person turns the rule on
update_ruleChanges a rule's name, description or graph, or pauses it with enabled: false. enabled: true is refused.WritesSee below
list_rule_versionsLists a rule's saved versions with who saved each one, its backtest and its approval.ReadsNone
draft_ruleTurns one plain-language sentence into a draft graph. Device, site, template and metric names are resolved against the project. Saves nothing.ReadsNone
validate_rule_graphChecks a graph and returns valid and a list of issues with the step and the field. Saves nothing.ReadsNone
backtest_ruleRuns a saved rule or an unsaved graph in dry run over stored readings for the last hours (default 24, at most 168) and returns a verdict. Sends and stores nothing.ReadsNone
enable_ruleAlways answers needs_a_person and changes nothing.NeitherA person turns rules on
disable_rulePauses a rule. Refused for the system rule "Store telemetry".WritesNone. Only a person can turn the rule on again
explain_ruleReturns a plain-language description of a rule: what triggers it, how conditions branch and what each action does.ReadsNone
get_rule_executionsReturns a rule's run history, newest first, up to 500 entries (default 50).ReadsNone

What update_rule does ​

CallRule is onRule is paused
Name or description only, no graphSaved at once as a new versionSaved at once as a new version
With graphNothing about the rule changes. The change is stored as the rule's open proposal with a 7-day backtest. A person approves or discards itSaved as a new paused version with the backtest. A person turns the rule on
With graph and enabled: falseThe rule is paused and the graph is saved. The rule stops running until a person turns it onSame as above
enabled: false onlyThe rule is pausedNo change
enabled: trueRefused with needs_a_personRefused with needs_a_person

The result has a note that says which of these happened. See Approvals.

Backtest verdicts ​

backtest_rule returns one of these verdicts: ok, never_fired, always_firing, flapping, noisy, no_history and unsupported (for rules that only have a schedule trigger). When truncated is true, the replay was cut short and covered_hours says how much of the window it covered. See Test a rule.

Metrics ​

ToolWhat it doesReads or writesApproval
query_metricsReturns stored readings for up to 100 devices: the latest value for each metric, raw points in a time range, or average, minimum, maximum and count for each bucket.ReadsNone

interval is one of 1m, 5m, 15m, 1h, 6h, 1d or 7d. Without from, the range starts 7 days ago. limit is at most 2000.

Project history ​

These four tools answer questions from the project's own stored readings.

ToolWhat it doesReads or writesApproval
get_baselineReturns what is normal for one device: how often it reports and the usual range of each numeric metric, learned from the last 14 days (up to 90).ReadsNone
get_sensor_healthSays whether a device's sensor is measuring or sends what a failing sensor sends. Without device_uid it returns every device with a finding.ReadsNone
suggest_thresholdReturns the number for a rule's condition from the devices' usual range, for one device, a site, a template or all devices that report the metric. Returns an error with a reason when there is not enough history.ReadsNone
review_rulesLists the running rules that the weekly health check flagged, with the verdict, the numbers behind it and advice on what to change.ReadsNone

suggest_threshold reads at most 25 devices in one call. A usual range needs at least 24 hours of history. See Rule health for the health verdicts.

What the server tells every agent ​

When a client connects, the server sends instructions with the tool list. In summary they say:

  • You can read the project, set it up and propose rules.
  • Agents propose and a person approves. A rule you create is saved paused, a change to a running rule waits as a proposal, and no tool turns a rule on.
  • There are no delete tools and no tools for API keys or settings. Pausing a rule is the most destructive thing you can do. Leave the system rule "Store telemetry" on.
  • Backtest a rule before you propose it.
  • When a tool answers with an error, read it. It says what to change.
  • Use suggest_threshold for the number of an alert, get_sensor_health to tell a failing sensor from a real reading, and review_rules to find running rules that went bad.
  • Call get_started first when you are new or set up a device.

Errors ​

A tool that refuses a call returns a result with an error code and usually a detail sentence that says what to do next. Examples are not_found, needs_a_person, graph validation failed with a list of issues, wrong_secret and not_enough_data. The call is logged as an error.

The call log ​

Each call is written to Logs with its arguments, the size of the result and who called. The newest calls are also under Settings › MCP server › Recent agent calls.

How the agent connectedWhat the log says
Over HTTP with a keyThe scope and the name of the key, for example by agent key "claude-code"
Over HTTP on an open instanceby an open connection from and the client address
Over stdioby the command on the server (stdio)

Arguments whose name looks like a secret, password, token or key are shown as •••.

Sensora is open source under the Apache 2.0 license.