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
| Tool | What it does | Reads or writes | Approval |
|---|---|---|---|
get_started | Returns the ordered path from nothing to a live device with a checked alert, and which tool does each step. | Reads | None |
get_firmware | Returns 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. | Reads | None |
await_first_reading | Waits 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. | Reads | None |
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
| Tool | What it does | Reads or writes | Approval |
|---|---|---|---|
list_devices | Lists all devices with status, battery, alert, site, template and integration. | Reads | None |
get_device | Returns one device and its latest value for each metric. | Reads | None |
create_device | Registers a device and returns its device_uid and its secret. The secret is shown once. | Writes | None |
update_device | Edits a device's name, site (zone), template, integration and external id. Only the fields you pass change. | Writes | None |
simulate_telemetry | Sends 1 to 500 simulated readings for a device through the same path as real readings. They are stored and labelled as simulated. | Writes | None |
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
| Tool | What it does | Reads or writes | Approval |
|---|---|---|---|
list_templates | Lists the device templates with the number of devices that use each one. | Reads | None |
get_template | Returns one template with its property and attribute mappings. | Reads | None |
create_template | Creates a template that maps payload fields to typed properties. | Writes | None |
search_template_library | Searches the built-in template library by vendor, model or slug. | Reads | None |
import_library_template | Imports a library template into the project as a copy you can edit. Importing the same one again returns the existing copy. | Writes | None |
Integrations and inbox
| Tool | What it does | Reads or writes | Approval |
|---|---|---|---|
list_integrations | Lists the webhook and MQTT integrations with device counts, inbox totals and endpoints. | Reads | None |
get_integration | Returns one integration with its endpoint, auto-provision settings and inbox totals. | Reads | None |
create_integration | Creates a webhook or MQTT integration. A webhook integration gets its own address with a token. | Writes | None |
list_inbox | Lists inbox entries: what an integration received and how each entry was processed. | Reads | None |
replay_inbox_item | Runs a held inbox entry through the pipeline again, for example after the missing device or template was created. | Writes | None |
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
| Tool | What it does | Reads or writes | Approval |
|---|---|---|---|
list_rules | Lists all rules with their state and graph. pending_approval and proposal show what waits for a person. | Reads | None |
get_rule | Returns one rule with its graph, its stored backtest, its approval, an open proposal with a diff, and its health. | Reads | None |
create_rule | Saves 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. | Writes | A person turns the rule on |
update_rule | Changes a rule's name, description or graph, or pauses it with enabled: false. enabled: true is refused. | Writes | See below |
list_rule_versions | Lists a rule's saved versions with who saved each one, its backtest and its approval. | Reads | None |
draft_rule | Turns one plain-language sentence into a draft graph. Device, site, template and metric names are resolved against the project. Saves nothing. | Reads | None |
validate_rule_graph | Checks a graph and returns valid and a list of issues with the step and the field. Saves nothing. | Reads | None |
backtest_rule | Runs 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. | Reads | None |
enable_rule | Always answers needs_a_person and changes nothing. | Neither | A person turns rules on |
disable_rule | Pauses a rule. Refused for the system rule "Store telemetry". | Writes | None. Only a person can turn the rule on again |
explain_rule | Returns a plain-language description of a rule: what triggers it, how conditions branch and what each action does. | Reads | None |
get_rule_executions | Returns a rule's run history, newest first, up to 500 entries (default 50). | Reads | None |
What update_rule does
| Call | Rule is on | Rule is paused |
|---|---|---|
Name or description only, no graph | Saved at once as a new version | Saved at once as a new version |
With graph | Nothing about the rule changes. The change is stored as the rule's open proposal with a 7-day backtest. A person approves or discards it | Saved as a new paused version with the backtest. A person turns the rule on |
With graph and enabled: false | The rule is paused and the graph is saved. The rule stops running until a person turns it on | Same as above |
enabled: false only | The rule is paused | No change |
enabled: true | Refused with needs_a_person | Refused 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
| Tool | What it does | Reads or writes | Approval |
|---|---|---|---|
query_metrics | Returns 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. | Reads | None |
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.
| Tool | What it does | Reads or writes | Approval |
|---|---|---|---|
get_baseline | Returns 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). | Reads | None |
get_sensor_health | Says whether a device's sensor is measuring or sends what a failing sensor sends. Without device_uid it returns every device with a finding. | Reads | None |
suggest_threshold | Returns 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. | Reads | None |
review_rules | Lists the running rules that the weekly health check flagged, with the verdict, the numbers behind it and advice on what to change. | Reads | None |
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_thresholdfor the number of an alert,get_sensor_healthto tell a failing sensor from a real reading, andreview_rulesto find running rules that went bad. - Call
get_startedfirst 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 connected | What the log says |
|---|---|
| Over HTTP with a key | The scope and the name of the key, for example by agent key "claude-code" |
| Over HTTP on an open instance | by an open connection from and the client address |
| Over stdio | by the command on the server (stdio) |
Arguments whose name looks like a secret, password, token or key are shown as •••.
