SafetyChain MCP by usefulapi
Read SafetyChain food safety records, CAPAs, forms, suppliers, items, locations and equipment.
Should I use this
Quality & Safety
Findings (3)
- LOWin safetychain_get_capa_attachments
- LOWin safetychain_get_capa_linked_records
- LOWin safetychain_get_capa_linked_capas
Based on automated analysis of tool definitions and protocol compliance.
Context Cost
This is the approximate number of tokens consumed each time the server's tools are loaded into a model's context. Higher counts reduce the attention available for other tasks.
Install
One-Click Install
Add this to your `claude_desktop_config.json` file:
{
"mcpServers": {
"safetychain": {
"url": "https://safetychain.usefulapi.io/mcp"
}
}
}Remote endpoints
https://safetychain.usefulapi.io/mcpstreamable-httpWhat it can do
Tool inventory
Tools (29)
🟢safetychain_list_customers(name, is_enabled, is_deleted, limit)
List customers of the SafetyChain tenant, with ids, names, enabled flags and created/modified dates. Filter by name. The API does not page: all matches come back (cut at limit). GET /clientapis/resourcemanagement/v1.0/customers.
Input Schema
{
"type": "object",
"properties": {
"name": {
"description": "Filter by customer name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_enabled": {
"description": "Only enabled (true) or disabled (false) rows.",
"type": "boolean"
},
"is_deleted": {
"description": "Only deleted (true) or not deleted (false) rows.",
"type": "boolean"
},
"limit": {
"description": "Return at most this many rows (default 200, max 1000); the reply says how many were cut.",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_customer(id)
Get one customer by id (an id from safetychain_list_customers). GET /clientapis/resourcemanagement/v1.0/customer/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "customer id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_list_locations(name, is_enabled, is_deleted, limit)
List locations (plants, sites, areas) of the SafetyChain tenant, with ids, names, enabled flags and created/modified dates. Filter by name. The API does not page: all matches come back (cut at limit). GET /clientapis/resourcemanagement/v1.0/locations.
Input Schema
{
"type": "object",
"properties": {
"name": {
"description": "Filter by location name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_enabled": {
"description": "Only enabled (true) or disabled (false) rows.",
"type": "boolean"
},
"is_deleted": {
"description": "Only deleted (true) or not deleted (false) rows.",
"type": "boolean"
},
"limit": {
"description": "Return at most this many rows (default 200, max 1000); the reply says how many were cut.",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_location(id)
Get one location by id (an id from safetychain_list_locations). GET /clientapis/resourcemanagement/v1.0/location/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "location id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_list_suppliers(name, is_enabled, is_deleted, limit)
List suppliers of the SafetyChain tenant, with ids, names, enabled flags and created/modified dates. Filter by name. The API does not page: all matches come back (cut at limit). GET /clientapis/resourcemanagement/v1.0/suppliers.
Input Schema
{
"type": "object",
"properties": {
"name": {
"description": "Filter by supplier name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_enabled": {
"description": "Only enabled (true) or disabled (false) rows.",
"type": "boolean"
},
"is_deleted": {
"description": "Only deleted (true) or not deleted (false) rows.",
"type": "boolean"
},
"limit": {
"description": "Return at most this many rows (default 200, max 1000); the reply says how many were cut.",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_supplier(id)
Get one supplier by id (an id from safetychain_list_suppliers). GET /clientapis/resourcemanagement/v1.0/supplier/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "supplier id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_list_items(name, is_enabled, is_deleted, limit)
List items (products, ingredients, materials) of the SafetyChain tenant, with ids, names, enabled flags and created/modified dates. Filter by name. The API does not page: all matches come back (cut at limit). GET /clientapis/resourcemanagement/v1.0/items.
Input Schema
{
"type": "object",
"properties": {
"name": {
"description": "Filter by item name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_enabled": {
"description": "Only enabled (true) or disabled (false) rows.",
"type": "boolean"
},
"is_deleted": {
"description": "Only deleted (true) or not deleted (false) rows.",
"type": "boolean"
},
"limit": {
"description": "Return at most this many rows (default 200, max 1000); the reply says how many were cut.",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_item(id)
Get one item by id (an id from safetychain_list_items). GET /clientapis/resourcemanagement/v1.0/item/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "item id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_list_equipment(name, is_enabled, is_deleted, limit)
List equipment of the SafetyChain tenant, with ids, names, enabled flags and created/modified dates. Filter by name. The API does not page: all matches come back (cut at limit). GET /clientapis/resourcemanagement/v1.0/equipment.
Input Schema
{
"type": "object",
"properties": {
"name": {
"description": "Filter by equipment name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_enabled": {
"description": "Only enabled (true) or disabled (false) rows.",
"type": "boolean"
},
"is_deleted": {
"description": "Only deleted (true) or not deleted (false) rows.",
"type": "boolean"
},
"limit": {
"description": "Return at most this many rows (default 200, max 1000); the reply says how many were cut.",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_equipment(id)
Get one equipment by id (an id from safetychain_list_equipment). GET /clientapis/resourcemanagement/v1.0/equipment/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "equipment id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_list_resources(name, is_enabled, limit)
List resources of every type (customers, equipment, items, suppliers, lists) of the SafetyChain tenant, with ids, names, enabled flags and created/modified dates. Filter by name. The API does not page: all matches come back (cut at limit). GET /clientapis/resourcemanagement/v1.0/resources.
Input Schema
{
"type": "object",
"properties": {
"name": {
"description": "Filter by resource name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_enabled": {
"description": "Only enabled (true) or disabled (false) rows.",
"type": "boolean"
},
"limit": {
"description": "Return at most this many rows (default 200, max 1000); the reply says how many were cut.",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_resource(id)
Get one resource by id (an id from safetychain_list_resources). GET /clientapis/resourcemanagement/v1.0/resource/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "resource id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_list_forms(name, is_current, is_released, limit)
List forms (the checklists and data-entry forms operators fill in) of the SafetyChain tenant, with ids, names, enabled flags and created/modified dates. Filter by name. The API does not page: all matches come back (cut at limit). GET /clientapis/resourcemanagement/v1.0/forms.
Input Schema
{
"type": "object",
"properties": {
"name": {
"description": "Filter by form name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_current": {
"description": "Only the current version of each form (true).",
"type": "boolean"
},
"is_released": {
"description": "Only released (true) or unreleased (false) forms.",
"type": "boolean"
},
"limit": {
"description": "Return at most this many rows (default 200, max 1000); the reply says how many were cut.",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_form(id)
Get one form by id (an id from safetychain_list_forms). GET /clientapis/resourcemanagement/v1.0/form/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "form id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_list_categories(name, is_enabled, is_deleted, parent_category_id, limit)
List categories used to group resources of the SafetyChain tenant, with ids, names, enabled flags and created/modified dates. Filter by name. The API does not page: all matches come back (cut at limit). GET /clientapis/resourcemanagement/v1.0/categories.
Input Schema
{
"type": "object",
"properties": {
"name": {
"description": "Filter by category name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_enabled": {
"description": "Only enabled (true) or disabled (false) rows.",
"type": "boolean"
},
"is_deleted": {
"description": "Only deleted (true) or not deleted (false) rows.",
"type": "boolean"
},
"parent_category_id": {
"description": "Only children of this category id.",
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$"
},
"limit": {
"description": "Return at most this many rows (default 200, max 1000); the reply says how many were cut.",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_category(id)
Get one category by id (an id from safetychain_list_categories). GET /clientapis/resourcemanagement/v1.0/category/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "category id"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_search_capas(search_term, capa_id, name_contains, owner_workgroup_contains, locations, ...)
Search corrective and preventive actions (CAPA, SCAR, CCAR). Filters combine with AND. Returns id, name, severity, owner workgroup, status, event and due dates, task counts, location and template type, 50 per page. Use the Id (a GUID) with safetychain_get_capa and the other CAPA tools. POST /clientapis/capamanagement/v1.0/capas (a read: it only searches).
Input Schema
{
"type": "object",
"properties": {
"search_term": {
"description": "Free-text search term.",
"type": "string",
"maxLength": 200
},
"capa_id": {
"description": "The numeric CAPA number (CapaId).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"name_contains": {
"description": "CAPA name contains this text.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"owner_workgroup_contains": {
"description": "Owner workgroup contains this text.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"locations": {
"description": "Location names or ids (up to 10).",
"minItems": 1,
"maxItems": 10,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"statuses": {
"description": "CAPA statuses, for example Draft, Open, Closed, Voided (up to 10).",
"minItems": 1,
"maxItems": 10,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"template_types": {
"description": "Template types.",
"minItems": 1,
"maxItems": 3,
"type": "array",
"items": {
"type": "string",
"enum": [
"CAPA",
"SCAR",
"CCAR"
]
}
},
"severities": {
"description": "Severity names (up to 10).",
"minItems": 1,
"maxItems": 10,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"descending": {
"description": "Sort descending.",
"type": "boolean"
},
"page": {
"description": "Page number, from 1 (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Rows per page (default 50, max 200).",
"type": "integer",
"minimum": 1,
"maximum": 200
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_capa(id)
Get one CAPA's details: status, severity, event and due dates, summary, creator, resource, source, category, owner workgroup, template and steps. The id is the GUID `Id` from safetychain_search_capas. GET /clientapis/capamanagement/v1.0/capa/{id}.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "CAPA id (GUID)"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_capa_tasks(id, page, page_size)
List a CAPA's tasks (step, form, location, resource, workgroup, assignee, due date, status). The id is the GUID `Id` from safetychain_search_capas. GET /clientapis/capamanagement/v1.0/capa/{id}/tasks.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "CAPA id (GUID)"
},
"page": {
"description": "Page number, from 1 (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Rows per page (default 50, max 200).",
"type": "integer",
"minimum": 1,
"maximum": 200
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_capa_attachments(id, page, page_size)
List a CAPA's attachments (name, extension, link, creator, date). The id is the GUID `Id` from safetychain_search_capas. GET /clientapis/capamanagement/v1.0/capa/{id}/attachments.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "CAPA id (GUID)"
},
"page": {
"description": "Page number, from 1 (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Rows per page (default 50, max 200).",
"type": "integer",
"minimum": 1,
"maximum": 200
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_capa_history(id, page, page_size)
List a CAPA's history entries. The id is the GUID `Id` from safetychain_search_capas. GET /clientapis/capamanagement/v1.0/capa/{id}/history.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "CAPA id (GUID)"
},
"page": {
"description": "Page number, from 1 (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Rows per page (default 50, max 200).",
"type": "integer",
"minimum": 1,
"maximum": 200
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_capa_linked_records(id, page, page_size)
List a CAPA's linked records. The id is the GUID `Id` from safetychain_search_capas. GET /clientapis/capamanagement/v1.0/capa/{id}/linkedrecords.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "CAPA id (GUID)"
},
"page": {
"description": "Page number, from 1 (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Rows per page (default 50, max 200).",
"type": "integer",
"minimum": 1,
"maximum": 200
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_capa_linked_capas(id, page, page_size)
List a CAPA's linked CAPAs. The id is the GUID `Id` from safetychain_search_capas. GET /clientapis/capamanagement/v1.0/capa/{id}/linkedcapas.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "CAPA id (GUID)"
},
"page": {
"description": "Page number, from 1 (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Rows per page (default 50, max 200).",
"type": "integer",
"minimum": 1,
"maximum": 200
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_capa_activity(id)
List a CAPA's activity (comments and events). The id is the GUID `Id` from safetychain_search_capas. GET /clientapis/capamanagement/v1.0/capa/{id}/activity.
Input Schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "CAPA id (GUID)"
}
},
"required": [
"id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_record(record_id)
Get one submitted record in full by its record id (the GUID `recordId` from safetychain_search_records): form, who submitted it and when, location, resource, field values, verifications. GET /clientapis/recordmanagement/v1.0/record/{recordId}.
Input Schema
{
"type": "object",
"properties": {
"record_id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "Record id (GUID)"
}
},
"required": [
"record_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_record_exists(record_id)
Check whether a record exists for a record id (GUID). GET /clientapis/recordmanagement/v1.0/record/{recordId}/Exists.
Input Schema
{
"type": "object",
"properties": {
"record_id": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"description": "Record id (GUID)"
}
},
"required": [
"record_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_search_records(date_type, start, end, min_ago, time_zone_offset, ...)
Search submitted records (the headers: record number, compliance, submitted date, location, form and version, resource, who submitted, signed, verifications, ids). Filter by date range, form, location, resource, identifier and compliance. Always narrow by a date range or a name: the tenant can hold millions of records. Pages are not snapshotted: for a stable multi-page read use a closed date range (start and end in the past). Use safetychain_get_record_fields for the field values. POST /clientapis/v2.0/getRecords (a read: it only searches).
Input Schema
{
"type": "object",
"properties": {
"date_type": {
"description": "Which date the range applies to (default submitted). processed = when SafetyChain saved it; modified = last change (includes submitted when never modified); modifiedOnly = only records actually modified.",
"type": "string",
"enum": [
"submitted",
"modified",
"modifiedOnly",
"processed"
]
},
"start": {
"description": "Start of the date range, yyyy-mm-dd or yyyy-mm-dd hh:mm:ss. Not together with min_ago.",
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}( \\d{2}:\\d{2}:\\d{2})?$"
},
"end": {
"description": "End of the date range (default: now).",
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}( \\d{2}:\\d{2}:\\d{2})?$"
},
"min_ago": {
"description": "Sliding window: records from the last N minutes (1440 = a day). Not together with start.",
"type": "integer",
"minimum": 1,
"maximum": 5256000
},
"time_zone_offset": {
"description": "Hours from UTC applied to the date filters and the dates returned (default 0).",
"type": "integer",
"minimum": -12,
"maximum": 14
},
"form_name": {
"description": "Exact form name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"form_like": {
"description": "Form name contains this text (slower than form_name).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"location_name": {
"description": "Exact location name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"location_like": {
"description": "Location name contains this text (slower).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"resource_name": {
"description": "Exact resource name (customer, equipment, item or supplier).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"resource_like": {
"description": "Resource name contains this text (slower).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"record_number": {
"description": "One record number.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"identifier_name": {
"description": "Identifier field name, for example Lot. Use together with identifier_value.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"identifier_value": {
"description": "Identifier value that goes with identifier_name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_signed": {
"description": "Only records with a sign-off or validation.",
"type": "boolean"
},
"is_verified": {
"description": "Only verified (true) records.",
"type": "boolean"
},
"record_compliance": {
"description": "Only compliant (true) or non-compliant (false) records. Records without compliance rules count as compliant.",
"type": "boolean"
},
"page": {
"description": "Page number, from 1 (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_rows": {
"description": "Rows per page (default 50, max 500).",
"type": "integer",
"minimum": 1,
"maximum": 500
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_record_fields(date_type, start, end, min_ago, time_zone_offset, ...)
Get the field-level values of records (one entry per record with its fields: name, short name, type, value, unit, compliance, min, max, target, comments, section). Same filters as safetychain_search_records; narrow strongly (a record number or one form and a short date range), each record carries many fields. POST /clientapis/v2.0/getRecordsWithFields (a read).
Input Schema
{
"type": "object",
"properties": {
"date_type": {
"description": "Which date the range applies to (default submitted). processed = when SafetyChain saved it; modified = last change (includes submitted when never modified); modifiedOnly = only records actually modified.",
"type": "string",
"enum": [
"submitted",
"modified",
"modifiedOnly",
"processed"
]
},
"start": {
"description": "Start of the date range, yyyy-mm-dd or yyyy-mm-dd hh:mm:ss. Not together with min_ago.",
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}( \\d{2}:\\d{2}:\\d{2})?$"
},
"end": {
"description": "End of the date range (default: now).",
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}( \\d{2}:\\d{2}:\\d{2})?$"
},
"min_ago": {
"description": "Sliding window: records from the last N minutes (1440 = a day). Not together with start.",
"type": "integer",
"minimum": 1,
"maximum": 5256000
},
"time_zone_offset": {
"description": "Hours from UTC applied to the date filters and the dates returned (default 0).",
"type": "integer",
"minimum": -12,
"maximum": 14
},
"form_name": {
"description": "Exact form name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"form_like": {
"description": "Form name contains this text (slower than form_name).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"location_name": {
"description": "Exact location name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"location_like": {
"description": "Location name contains this text (slower).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"resource_name": {
"description": "Exact resource name (customer, equipment, item or supplier).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"resource_like": {
"description": "Resource name contains this text (slower).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"record_number": {
"description": "One record number.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"identifier_name": {
"description": "Identifier field name, for example Lot. Use together with identifier_value.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"identifier_value": {
"description": "Identifier value that goes with identifier_name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_signed": {
"description": "Only records with a sign-off or validation.",
"type": "boolean"
},
"is_verified": {
"description": "Only verified (true) records.",
"type": "boolean"
},
"record_compliance": {
"description": "Only compliant (true) or non-compliant (false) records. Records without compliance rules count as compliant.",
"type": "boolean"
},
"field_names": {
"description": "Only these fields, by full field name.",
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"field_short_names": {
"description": "Only these fields, by short name.",
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"page": {
"description": "Page number, from 1 (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_rows": {
"description": "Records per page (default 20, max 100).",
"type": "integer",
"minimum": 1,
"maximum": 100
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢safetychain_get_record_summary(date_type, start, end, min_ago, time_zone_offset, ...)
Fast summary of the records matching the filters: first and last date, and how many forms, resources, locations and users are involved. Use it to size a request before safetychain_search_records. POST /clientapis/v2.0/getRecordSummary (a read).
Input Schema
{
"type": "object",
"properties": {
"date_type": {
"description": "Which date the range applies to (default submitted). processed = when SafetyChain saved it; modified = last change (includes submitted when never modified); modifiedOnly = only records actually modified.",
"type": "string",
"enum": [
"submitted",
"modified",
"modifiedOnly",
"processed"
]
},
"start": {
"description": "Start of the date range, yyyy-mm-dd or yyyy-mm-dd hh:mm:ss. Not together with min_ago.",
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}( \\d{2}:\\d{2}:\\d{2})?$"
},
"end": {
"description": "End of the date range (default: now).",
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}( \\d{2}:\\d{2}:\\d{2})?$"
},
"min_ago": {
"description": "Sliding window: records from the last N minutes (1440 = a day). Not together with start.",
"type": "integer",
"minimum": 1,
"maximum": 5256000
},
"time_zone_offset": {
"description": "Hours from UTC applied to the date filters and the dates returned (default 0).",
"type": "integer",
"minimum": -12,
"maximum": 14
},
"form_name": {
"description": "Exact form name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"form_like": {
"description": "Form name contains this text (slower than form_name).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"location_name": {
"description": "Exact location name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"location_like": {
"description": "Location name contains this text (slower).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"resource_name": {
"description": "Exact resource name (customer, equipment, item or supplier).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"resource_like": {
"description": "Resource name contains this text (slower).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"record_number": {
"description": "One record number.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"identifier_name": {
"description": "Identifier field name, for example Lot. Use together with identifier_value.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"identifier_value": {
"description": "Identifier value that goes with identifier_name.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"is_signed": {
"description": "Only records with a sign-off or validation.",
"type": "boolean"
},
"is_verified": {
"description": "Only verified (true) records.",
"type": "boolean"
},
"record_compliance": {
"description": "Only compliant (true) or non-compliant (false) records. Records without compliance rules count as compliant.",
"type": "boolean"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Community
Evidence