Rela AIRela AI Docs
Tools

Built-in Query Tools

Predefined actions your AI agents can use to query platform data without any additional configuration.

What are built-in tools?

Built-in query tools are action-type functions predefined by the platform that WhatsApp and Email agents can use directly — no setup required. Once registered on your agent, they are ready to use.

How do they work?

When a user writes a question like "When is the next maintenance for compressor C-101?", the agent analyzes the conversation and automatically uses the right tool to query the system and respond with real data — without the operator needing to open any screen or export any file.

The agent decides which tool to use based on each action's description and the conversation context.

Available tools

Maintenance

Tools to query the status of preventive maintenance plans.


query_maintenance_plans

Queries the list of preventive maintenance plans along with their next scheduled execution date.

When to useWhen the user asks about upcoming maintenance dates or the maintenance calendar.
Example"When is the next maintenance for compressor C-101?"
ReturnsList of plans with asset name, next execution date, frequency, and assigned responsible.

query_overdue_maintenance

Queries maintenance plans that have passed their scheduled date and have not been executed.

When to useWhen the user asks about overdue, late, or pending maintenance.
Example"What maintenance tasks are overdue on line 2?"
ReturnsList of overdue plans with days of delay, affected asset, and last recorded execution.

query_compliance

Queries the compliance level of maintenance plans against SLA and regulatory requirements for the period.

When to useWhen the user asks about the compliance percentage or how many plans are on schedule.
Example"How many maintenance plans are behind schedule this month?"
ReturnsCompliance metrics: plans executed vs. scheduled, compliance percentage, late plans, and at-risk plans.

Energy

Tools to monitor energy consumption and detect anomalies.


query_energy_consumption

Queries the plant's energy consumption or specific sources over a given period.

When to useWhen the user asks about energy consumption, energy costs, or period-over-period comparisons.
Example"How much energy did the plant consume last week?"
ReturnsTotal consumption (kWh), breakdown by energy source, comparison with previous periods, and estimated cost.

get_energy_anomalies

Queries recently detected energy consumption anomalies from the monitoring system.

When to useWhen the user asks whether any equipment has unusual consumption or unjustified energy spikes.
Example"Is there any equipment with abnormal energy consumption?"
ReturnsList of active energy anomalies with affected asset, deviation from baseline, severity, and detection date.

Quality (SPC)

Tools to query the status of statistical process control.


query_spc_charts

Queries the list of SPC (Statistical Process Control) charts configured on the platform.

When to useWhen the user asks how many control charts are active or which variables are being monitored.
Example"How many control charts do we have active?"
ReturnsList of SPC charts with name, monitored variable, associated process, and status (active/inactive).

get_spc_chart_status

Queries the current status of a specific SPC chart: whether the process is in statistical control or has recorded out-of-control signals.

When to useWhen the user asks whether a process or production line is under statistical control.
Example"Is production line 3 out of statistical control?"
ReturnsCurrent chart status (in control / out of control), number of out-of-limit points, last alarm signal, and detected trends.

Safety — Inspections

Tools to query inspection history and status.


query_inspections

Queries past and pending inspections with filters by asset, status, or period.

When to useWhen the user asks about an asset's inspection history or whether there are pending inspections.
Example"When was the last inspection of tank T-10?"
ReturnsList of inspections with date, inspected asset, result (passed/failed/observations), and responsible inspector.

get_inspection_details

Queries the full details of a specific inspection.

When to useWhen the user wants to know the findings, observations, or corrective actions from a specific inspection.
Example"What did they find in last week's inspection?"
ReturnsDetailed inspection report: completed checklist, findings, attached photos, observations, and generated corrective actions.

Safety — LOTO

Tools to verify the status of Lockout/Tagout (LOTO) procedures.


query_loto_procedures

Queries the LOTO procedures available for a specific asset.

When to useWhen the user needs to know whether a LOTO procedure exists for a piece of equipment before starting maintenance work.
Example"Is there a LOTO procedure for the main transformer?"
ReturnsList of available LOTO procedures for the asset with name, isolation points, and last review date.

check_loto_status

Checks whether an asset currently has an active LOTO lock applied.

When to useWhen the user needs to confirm whether equipment is locked out for maintenance before operating or intervening.
Example"Is compressor C-101 locked out for maintenance right now?"
ReturnsAsset LOTO status (locked/free), technician who applied the lock, start date/time, and reason for the lockout.

Inventory

Tools to query the status of spare parts and materials inventory.


query_inventory

Queries available parts in inventory with filters by type, reference, or location.

When to useWhen the user asks about the availability of spare parts, components, or materials in the warehouse.
Example"Do we have 6205 bearings in stock?"
ReturnsList of inventory items with reference, description, available quantity, warehouse location, and unit cost.

check_stock_level

Queries the stock level of a specific part and whether it is below the minimum reorder level.

When to useWhen the user asks about the exact quantity of an item or whether a purchase order is needed.
Example"How many oil filters do we have left?"
ReturnsCurrent stock quantity, configured minimum level, low stock indicator, and suggested reorder supplier.

Performance — SLA and KPIs

Tools to measure operational performance and service level agreement compliance.


get_sla_metrics

Queries SLA metrics for the period: compliance percentage, average response, and resolution times.

When to useWhen the user wants to know the overall performance of the maintenance team against SLAs.
Example"What is our SLA compliance this month?"
ReturnsSLA compliance percentage, average response time (MTTR), mean time between failures (MTBF), and period trend.

get_sla_breaches

Queries tasks or work orders that have breached SLA during the period.

When to useWhen the user asks about specific SLA violations or wants to identify orders that exceeded the time limit.
Example"Which work orders exceeded the time limit?"
ReturnsList of breaches with work order, asset, actual vs. allowed response time, and assigned responsible.

get_asset_kpis

Queries reliability KPIs for a specific asset: MTBF, MTTR, availability, and OEE.

When to useWhen the user asks about the performance indicators of a piece of equipment over a given period.
Example"What is the MTBF of compressor C-101 this year?"
ReturnsAsset KPIs: MTBF (mean time between failures), MTTR (mean time to repair), operational availability, and OEE where applicable.

query_underperforming_assets

Queries the assets with the worst performance on reliability KPIs for the period.

When to useWhen the user wants to identify the most problematic equipment or assets requiring priority attention.
Example"What are the 5 assets with the lowest availability?"
ReturnsAsset performance ranking with name, reference KPI, current value, and comparison against plant average.

Performance — Benchmarking

Tools to compare the performance of similar assets against each other.


query_benchmark_groups

Queries the benchmarking groups configured on the platform and their member assets.

When to useWhen the user asks about the available comparison groups or which assets are being compared.
Example"What benchmarking groups do we have configured?"
ReturnsList of benchmarking groups with name, member assets, reference KPI, and last updated date.

get_asset_ranking

Queries the ranking of assets within a benchmarking group according to a specific KPI (availability, MTBF, OEE, etc.).

When to useWhen the user wants to know which asset has the best or worst performance within a comparable group.
Example"Which compressor has the highest availability in the group?"
ReturnsOrdered ranking of assets in the group with KPI value, relative position, and deviation from the group average.

Performance — Asset Health

Tools to evaluate the overall health status of industrial assets.


query_asset_health

Queries the calculated health score for plant assets, based on multiple reliability indicators.

When to useWhen the user asks about the general health of an asset or wants a summary of its condition.
Example"What is the health of motor M-205?"
ReturnsHealth score (0–100), factors affecting the score, trend, and recommended actions.

get_asset_health

Queries the detailed health score of a specific asset along with the reliability KPIs that compose it.

When to useWhen the user needs the full breakdown of a specific asset's health status.
Example"What is the health status of turbine T-01?"
ReturnsDetailed health score with KPI breakdown (availability, MTBF, maintenance compliance), active alerts, and forecast.

query_critical_assets

Queries the list of assets whose health score is below a critical threshold.

When to useWhen the user wants to quickly identify which assets are in critical condition and require intervention.
Example"What equipment is in critical condition?"
ReturnsList of critical assets with current health score, alert threshold, time in critical state, and recommended actions.

query_asset_prognostics

Queries remaining useful life forecasts and failure probability for monitored assets.

When to useWhen the user asks how long an asset has before a probable failure or when it should be replaced.
Example"How many hours does pump B-103 have left before failure?"
ReturnsEstimated remaining useful life (hours/days), failure probability over the next period, most likely failure mode, and model confidence.

Anomalies

Tools to detect and manage anomalies identified by machine learning models.


query_anomalies

Queries anomalies detected by ML models with filters by source, asset, or status.

When to useWhen the user asks whether there are active anomalies in a specific area, line, or piece of equipment.
Example"Are there any active anomalies on the packaging line?"
ReturnsList of anomalies with asset, anomaly type, severity (low/medium/high/critical), model source, and detection date.

get_anomaly_summary

Queries an aggregated summary of active anomalies classified by severity.

When to useWhen the user wants a quick overview of the anomaly status across the plant without going into detail.
Example"How many critical anomalies do we have today?"
ReturnsAnomaly count by severity level (critical, high, medium, low), trend vs. previous day, and most affected areas.

Usage notes

  • Built-in tools require no parameter configuration or URL setup. They just need to be registered on the agent.
  • The agent selects the correct tool automatically based on the conversation context.
  • To enable a built-in tool on your agent, go to the agent settings and add it from the available tools section.
  • If you need to filter results by plant, line, or specific period, you can configure default values on the tool to fix that context.

Action Tools

Action tools allow the agent to perform real operations in the system: create work orders, send messages, generate documents, and verify identities. Unlike query tools, these modify data or trigger external actions (notifications, emails, WhatsApp messages).


Task and Personnel Management


locate_nearest_personnel

Finds the nearest active technician to a geographic location within a department. Useful for rapid assignment during emergencies or field work.

When to useWhen you need to know who is available near a location to attend an incident or urgent maintenance.
Example 1"Who is available in Monterrey to attend the compressor failure?"
Example 2"I need an instrumentation technician near the north plant."
Example 3"Is there anyone from the electrical area in Guadalajara?"
NeedsTarget location's country and city. The department is configured in the agent.
ReturnsList of active technicians sorted by proximity: full name, email, phone, role, and distance level (same city / same state / same country).

assign_task

Creates a work order and assigns it to a technician. Automatically generates a unique task code (e.g. MAN-042). If configured, sends email and/or WhatsApp notifications to the assigned technician at the time of creation.

When to useWhen the user wants to open a work order or assign work from the conversation.
Example 1"Assign the filter replacement on pump B-201 to Juan García, high priority."
Example 2"Create a task to check the oil level on compressor C-101 and notify Roberto on WhatsApp."
Example 3"Open an urgent maintenance order for turbine T-03."
NeedsTask title and the assigned technician (the agent can find them with locate_nearest_personnel). Priority, description, and due date are optional.
ReturnsCreated task code, name of the assigned technician, and status of sent notifications (email / WhatsApp).

update_task

Updates the status, priority, description, or assigned technician of an existing task. The agent can record progress during the conversation without the operator entering the dashboard.

When to useWhen the user reports that a task changed status, needs reassignment, or its description needs updating.
Example 1"Task MAN-042 is now in progress."
Example 2"Change the priority of order VEN-015 to urgent."
Example 3"Task MAN-042 is done."
NeedsTask code (e.g. MAN-042) or its ID, and at least one field to update: status, priority, description, due date, or technician.
ReturnsConfirmation of updated fields, current status, and current priority of the task.

Valid statuses: backlog, todo, in_progress, done, cancelled.


get_task

Retrieves all the details of a task by its code or ID. Useful when the operator wants to know the current status of a specific work order.

When to useWhen the user asks about the status, assignee, or details of a specific task.
Example 1"What is the status of order MAN-042?"
Example 2"Who has task VEN-015 assigned?"
Example 3"Give me the details of work order 003."
NeedsTask code (e.g. MAN-042) or its ID.
ReturnsAll task details: title, description, status, priority, assigned technician, creation and update dates, task code.

Authentication and Access


authenticate_conversation

Verifies the user's identity by searching their data in a configured database. Allows restricting access to certain data or actions based on the authenticated user's role.

When to useWhen the agent needs to confirm the user's identity before showing sensitive information or executing protected actions.
Example 1"Only authorized personnel can view this report. Please provide your employee number."
Example 2"To continue, I need to verify your identity. What is your access key?"
NeedsThe identification value the user provides in the conversation (e.g. employee number, ID, key). The search field and data collection are configured in the agent.
ReturnsSession state: authenticated if the record was found, or pending if additional OTP verification is required. The user's assigned roles become available to the agent.

send_verification_otp

Generates and sends a 6-digit verification code (OTP) to the user's phone or email to confirm their identity in a two-step process. The code expires in 5 minutes and allows a maximum of 3 attempts.

When to useAfter authenticate_conversation when additional two-factor confirmation is required.
Example 1"I sent you a verification code to your registered number. Please enter it to continue."
Example 2"To confirm your identity, we sent a code to your registered email."
NeedsPrior authentication must be in pending state. The delivery channel (WhatsApp or email) is configured in the agent.
ReturnsSend confirmation, channel used (whatsapp/email), masked destination for privacy (e.g. ***5678), and expiration time.

verify_otp

Verifies the OTP code entered by the user. If correct, completes authentication and grants access for 24 hours.

When to useWhen the user enters the OTP code they received via WhatsApp or email.
Example 1"My code is 482931."
Example 2"The code I received is 771204."
NeedsThe 6-digit code provided by the user in the conversation.
Returnsauthenticated status if the code is correct, along with the user's roles. If the code is incorrect, informs how many attempts remain.

Reports


generate_report

Generates a PDF report with corporate branding (logo, colors, header, and footer). The report is stored in the cloud and the agent can send it via WhatsApp or email immediately after generating it.

When to useWhen the user requests a report, summary, or document to share with their team.
Example 1"Generate the weekly maintenance report and send it to me on WhatsApp."
Example 2"I need a PDF with the shift alarm summary."
Example 3"Prepare a report on critical assets and send it to the supervisor."
NeedsReport title and the content the agent collects during the conversation (can combine data from other tools). Branding is configured in the agent.
ReturnsGenerated report ID, signed URL for PDF download, and number of pages. The agent can use that ID directly to attach the PDF in an email or send it via WhatsApp.


Searches the internet using the configured search engine. Supports general web search and news search. Can filter results by specific domain if configured by the administrator.

When to useWhen the user asks about information not in the plant's internal data: industry news, equipment technical specifications, regulations, input prices.
Example 1"What are the latest ISO standards for industrial maintenance?"
Example 2"Find the technical manual for Siemens motor 1LA7."
Example 3"What is happening with steel prices this week?"
NeedsThe search text the user provides. Maximum number of results and allowed domains are configured in the agent.
ReturnsList of results with title, link, and summary of each found page. Also includes alternative search suggestions if results are limited.

WhatsApp Messaging

These tools are automatically available in all WhatsApp channel agents.


send_whatsapp_message

Sends a text message to a WhatsApp number. Available in WhatsApp and Email agents.

When to useWhen the agent needs to send a notification, summary, or confirmation to a specific number.
Example 1"Notify Roberto at 5512345678 that pump B-201 needs urgent inspection."
Example 2"Send a message to the supervisor with the shift summary."
NeedsDestination phone number (with country code) and the message text. The agent's WhatsApp number is configured in the tool.
ReturnsSend confirmation with the destination number and message preview.

send_file (WhatsApp)

Sends a file (PDF, image) to the current WhatsApp user. Typically used after generating a report with generate_report.

When to useWhen the user asks to be sent a document or image during the WhatsApp conversation.
Example 1"Send me the PDF report."
Example 2"Send me the diagram image."
NeedsSigned URL of the file (obtained from generate_report or another tool) and filename.
ReturnsConfirmation that the file was sent to the current conversation user.

send_message_to

Sends a WhatsApp message to a different number than the current conversation user. Useful for notifying a third party (supervisor, technician, support area).

When to useWhen the agent needs to communicate something to a person other than the current interlocutor.
Example 1"Notify the shift supervisor that there is an active alarm on line 3."
Example 2"Forward this message to the purchasing department."
NeedsDestination phone number (with country code) and the message text. Only available in WhatsApp conversations.
ReturnsSend confirmation to the indicated number.

send_contact

Sends a contact card to the current WhatsApp user. Useful when the agent locates a technician with locate_nearest_personnel and wants to share their contact details.

When to useWhen the user asks for someone's contact information found in the system.
Example 1"Share the available technician's contact with me."
Example 2"Send me the shift supervisor's details."
NeedsFull name and phone number of the contact (with country code). Only available in WhatsApp conversations.
ReturnsConfirmation that the contact card was sent to the user.

send_location

Sends a GPS location pin to the current WhatsApp user.

When to useWhen the agent needs to indicate the location of an asset, facility, or meeting point.
Example 1"Where is the compressor room?"
Example 2"Send me the location of the north electrical substation."
NeedsLatitude and longitude coordinates. Name and address are optional. Only available in WhatsApp conversations.
ReturnsConfirmation that the location pin was sent to the user.

Email Messaging

These tools are automatically available in all email channel agents.


send_email

Sends an email from a registered email account on the platform. Can automatically attach a PDF report if one was previously generated.

When to useWhen the user requests sending an email from the email agent, or the agent needs to send a formal notification by email.
Example 1"Send the weekly report to the plant manager."
Example 2"Send an email to procurement@company.com with the request summary."
Example 3"Send the failure analysis PDF to the engineering team."
NeedsDestination address, subject, and email body. If a report was generated, the agent can attach it automatically with the report ID. The sender email account is configured in the agent.
ReturnsSend confirmation with sender, recipient, subject, and indicator of whether a file was attached.

attach_file (Email)

Attaches a file to the email reply the agent is composing. The file is kept pending and included when the agent sends the reply to the current conversation user.

When to useWhen the user asks to attach a document to the email reply that is about to be sent.
Example 1"Attach the report to the reply email."
Example 2"Include the PDF in your response."
NeedsSigned URL of the file (obtained from generate_report or another tool) and filename. Only available in email conversations. Limit: 5 files and 10 MB per file.
ReturnsConfirmation that the file is pending to be attached to the current reply.

send_email_to

Sends an email to a different recipient than the original sender of the conversation. Useful for notifying a third party or forwarding information to another department.

When to useWhen the agent must notify someone other than the current conversation participant.
Example 1"Notify the maintenance manager about this alarm."
Example 2"Forward the summary to the industrial safety area."
NeedsDestination email address, subject, and message body. Can optionally include a report ID to attach it. Only available in email conversations.
ReturnsSend confirmation with the recipient and subject.

Action tools usage notes

  • Action tools that modify data (create task, update task) record the creator as ai_assistant for traceability.
  • Notifications from assign_task are sent automatically when the task is created — the agent does not need to invoke additional messaging tools for that.
  • WhatsApp tools (send_file, send_message_to, send_contact, send_location) only work within WhatsApp conversations.
  • Email tools (attach_file, send_email_to) only work within email conversations.
  • The typical report flow is: generate_report → get report_idsend_file (WhatsApp) or send_email with the report_id.
  • The typical emergency assignment flow is: locate_nearest_personnel → choose technician → assign_task → automatic notification.

On this page