defect-inspection-tools-mcp-server
Version:
Defect inspection tools server handling defect detection, analysis, and reporting with AI/ML capabilities for quality control
714 lines • 36.7 kB
JavaScript
export const listToolsRequestSchema = {
type: "object",
properties: {
category: {
type: "string",
description: "Optional category to filter tools by",
enum: ["search", "stage", "inspection", "report", "status", "export", "vessel", "schema", "tmsa", "sire", "cdi", "vir", "audit", "psc", "summary", "document", "casefile"]
},
search: {
type: "string",
description: "Optional search term to filter tools by name or description"
},
include_deprecated: {
type: "boolean",
description: "Whether to include deprecated tools in the response",
default: false
}
},
additionalProperties: false
};
export const toolDefinitions = [
{
name: "universal_defect_search",
description: "Universal fallback search tool for vessel defects, inspection findings, and compliance issues across all maritime data sources (SHIPPALM, OCIMF, CDI, CLASS, PSC). Use this tool when focused search tools don't match user requirements or when complex multi-field queries are needed. Supports natural language queries, comprehensive filtering, and cross-source data retrieval for any defect-related information.",
inputSchema: {
type: "object",
properties: {
query: {
type: "string",
description: "Natural language or keyword query that searches across multiple fields including finding details, inspection types, report types, inspecting entities, and locations. Use descriptive terms or specific keywords - the tool will intelligently match against relevant fields. Use '*' to retrieve all records.",
default: "*"
},
filters: {
type: "object",
description: "Optional filters to narrow the search results. Only use this if exact field values are known.",
properties: {
imo: {
type: "number",
description: "IMO number of the vessel"
},
vesselName: {
type: "string",
description: "Exact or partial name of the vessel"
},
source: {
type: "string",
description: "Data source from which the defect record was taken",
enum: ["SHIPPALM", "OCIMF", "CDI", "CLASS", "PSC"]
},
inspectionType: {
type: "string",
description: "Specific type of inspection carried out (e.g., 'PSC INSPECTION', 'SIRE INSPECTION', 'INTERNAL AUDIT ISM/MLC/ISO')"
},
reportType: {
type: "string",
description: "Type of report used in the inspection (e.g., 'DEFICIENCY', 'NEAR MISS REPORT', 'NC/NON CONFORMITY REPORT')"
},
stage: {
type: "string",
description: "Current stage of the defect within the inspection process",
enum: ["OPEN", "CLOSED", "OPEN OVERDUE"]
},
currentStatus: {
type: "string",
description: "Detailed status of the inspection or defect (e.g., 'APPROVED', 'IN PROGRESS', 'CLOSED')"
},
riskCategory: {
type: "string",
description: "Risk level assigned to the defect",
enum: ["Low", "Medium", "High"]
},
mouWebsite: {
type: "string",
description: "Memorandum of Understanding (MOU) region for PSC inspections (e.g., 'PARIS MOU', 'TOKYO MOU')"
},
detention: {
type: "string",
description: "Indicates whether the vessel was detained during PSC inspection",
enum: ["YES", "NO"]
},
isExtended: {
type: "boolean",
description: "Filter for defects that have had their rectification deadline formally extended"
},
latestReport: {
type: "boolean",
description: "Filter for records belonging to the latest inspection/report only"
},
findingsReference: {
type: "string",
description: "Exact identification number of the finding or inspection"
},
reportDate_range: {
type: "object",
description: "Filter by date the defect was reported",
properties: {
start_date: {
type: "string",
format: "date",
description: "Start date (YYYY-MM-DD)"
},
end_date: {
type: "string",
format: "date",
description: "End date (YYYY-MM-DD)"
}
}
},
closingDate_range: {
type: "object",
description: "Filter by date the defect was rectified/closed",
properties: {
start_date: {
type: "string",
format: "date",
description: "Start date (YYYY-MM-DD)"
},
end_date: {
type: "string",
format: "date",
description: "End date (YYYY-MM-DD)"
}
}
},
targetDate_range: {
type: "object",
description: "Filter by target deadline for rectifying the defect",
properties: {
start_date: {
type: "string",
format: "date",
description: "Start date (YYYY-MM-DD)"
},
end_date: {
type: "string",
format: "date",
description: "End date (YYYY-MM-DD)"
}
}
}
}
},
sort_by: {
type: "string",
description: "Field to sort results by. 'relevance' sorts by internal match quality (applies to keyword searches only). Other fields must be sortable in the underlying index.",
enum: ["relevance", "reportDate", "closingDate", "targetDate", "isExtended", "latestReport"],
default: "relevance"
},
sort_order: {
type: "string",
description: "Sorting order of the results",
enum: ["asc", "desc"],
default: "desc"
},
max_results: {
type: "number",
description: "Maximum number of results to return",
default: 25,
minimum: 1,
maximum: 100
}
},
required: ["query"],
additionalProperties: false
}
},
{
name: "list_defects_by_stage",
description: "Use this tool to list defect (inspection-finding) records for a vessel that match one or more **stage** values (e.g., \"OPEN\", \"OPEN OVERDUE\", \"CLOSED\").\n\nHow it works:\n1. Identify the vessel by its IMO number (or name).\n2. Read the desired **stage** filter from the user's request. Enum values include \"OPEN\", \"OPEN OVERDUE\", \"CLOSED\", etc. You may pass a single value or a comma-separated list if the user asks for multiple stages.\n3. Query the *defect* collection combining the vessel's `imo` filter with the chosen `stage` filter(s).\n4. The tool returns comprehensive defect fields, including reference number, finding, risk category, corrective action, and key inspection dates.\n5. Optionally specify how many results to return per page.\n\nExample question: \"Give me a list of defects that are **overdue** for VESSEL_NAME.\" → use `imo=IMO_NUMBER`, `stage=\"OPEN OVERDUE\"`.",
inputSchema: {
type: "object",
required: ["imo", "stage"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
stage: {
type: "string",
description: "Stage value (or comma-separated list) to filter defects, e.g., \"OPEN\", \"OPEN OVERDUE\", \"CLOSED\".",
enum: ["OPEN", "CLOSED", "OPEN OVERDUE"]
},
per_page: {
type: "number",
description: "Number of records to return per page (default is 250)."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "list_defects_by_inspection_type",
description: "Use this tool to list defect (inspection-finding) records for a vessel that belong to a **specific inspection or audit type**—for example *INTERNAL AUDIT*, *SIRE INSPECTION*, or *PSC INSPECTION*. You may also, if needed, narrow the results to one of three **stage** values (OPEN, OPEN OVERDUE, or CLOSED).\n\nHow to use it\n1. Identify the vessel by its IMO number (or name).\n2. Select one or more of the allowed **inspectionType** enum values.\n3. (Optional) Provide a **stage** filter—choose ONE of \"OPEN\", \"OPEN OVERDUE\", or \"CLOSED\". Omit this field to retrieve all stages.\n4. Query the *defect* collection combining:\n • the vessel's `imo`,\n • `inspectionType` equal to the selected enum value, and\n • if supplied, `stage` equal to the chosen stage.\n5. Optionally specify how many results you want per page.\n\nExample question: \"Open Internal Audit defects for VESSEL_NAME.\" → `imo = IMO_NUMBER`, `inspectionType = INTERNAL AUDIT`, `stage = OPEN`.",
inputSchema: {
type: "object",
required: ["imo", "inspectionType"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
inspectionType: {
type: "string",
description: "Inspection/Audit type to filter. Multiple types can be sent as comma separated values.",
enum: [
"2ENG TOV AUDIT/SECOND ENGINEER TOV AUDIT",
"CARGO AND BALLAST AUDIT",
"CDI INSPECTION",
"CE TOV AUDIT/CHIEF ENGINEER TOV AUDIT",
"CHARTERERS INSPECTION",
"CLASS INSPECTION",
"COFF TOV AUDIT",
"DIRECTOR VISIT",
"DYNAMIC CARGO / BUNKER AUDIT",
"DYNAMIC MOORING / ANCHORING AUDIT",
"DYNAMIC NAVIGATION AUDIT",
"ENVIRONMENT AUDIT",
"EXTERNAL AUDIT",
"EXTERNAL ISM AUDIT",
"EXTERNAL ISPS AUDIT",
"EXTERNAL MLC INSPECTION",
"FLAG STATE INSPECTION",
"INTERNAL AUDIT",
"INTERNAL AUDIT ISM/MLC/ISO",
"INTERNAL AUDIT ISPS AUDIT",
"MANAGER VISIT",
"MSTR NAV AUDIT/MASTER NAVIGATIONAL AUDIT",
"MSTR TOV AUDIT/MASTER TOV AUDIT",
"NAVIGATION AUDIT",
"OTHER INSPECTION/AUDIT",
"OWNER'S INSPECTION",
"PORT HEALTH INSPECTION",
"PSC INSPECTION",
"REMOTE SHIP INSPECTION",
"RIGHTSHIP INSPECTION",
"SCMM",
"SIRE INSPECTION",
"SUPERINTENDENT VISIT",
"TERMINAL INSPECTION",
"USCG COC INSPECTION",
"VIR"
]
},
stage: {
type: "string",
enum: ["OPEN", "OPEN OVERDUE", "CLOSED"],
description: "Optional stage filter (omit to include all stages)."
},
per_page: {
type: "number",
description: "Number of records to return per page (default is 250)."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "list_defects_by_report_type",
description: "Use this tool to list defect / safety-management records for a vessel that belong to a specific **reportType** (e.g., \"NEAR MISS REPORT\", \"ACCIDENT / INCIDENT REPORT\"). You can also, if needed, narrow the results to a particular **stage** (OPEN, OPEN OVERDUE, or CLOSED).\n\nHow to use it\n1. Identify the vessel by its IMO number (or name).\n2. Select one of the allowed **reportType** enum values.\n3. (Optional) Provide a **stage** filter—choose ONE of \"OPEN\", \"OPEN OVERDUE\", or \"CLOSED\". Omit this field if you want all stages.\n4. Query the *defect* collection combining the vessel's `imo`, the chosen `reportType`, and—if supplied—the `stage` value.\n5. Optionally set how many results to return per page.\n\nExample: \"Open Near-Miss reports for VESSEL_NAME\" → use `imo=IMO_NUMBER`, `reportType=\"NEAR MISS REPORT\"`, `stage=OPEN`.",
inputSchema: {
type: "object",
required: ["imo", "reportType"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
reportType: {
type: "string",
description: "Report type to filter. Multiple types can be sent as comma separated values.",
enum: [
"ACCIDENT / INCIDENT REPORT",
"BEST PRACTICE",
"COC",
"DEFICIENCY",
"DEVIATION",
"DISPENSATION",
"FAILURE",
"HULL MACHINERY DEFECT/HMX",
"LARP",
"MEMO/MEMORANDA",
"NC/NON CONFORMITY REPORT",
"NEAR MISS REPORT",
"NOTES",
"OBSERVATION",
"SUGGESTION FOR IMPROVEMENTS",
"SUSPENSION",
"SHIPBOARD MANAGEMENT REVIEW",
"RISK MANAGEMENT",
"VESSEL REJECTION",
"MANAGEMENT OF CHANGE/MGMT OF CHANGE",
"SAFETY MEETING"
]
},
stage: {
type: "string",
enum: ["OPEN", "OPEN OVERDUE", "CLOSED"],
description: "Optional stage filter (omit to include all stages)."
},
per_page: {
type: "number",
description: "Number of records to return per page (default is 250)."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "list_defects_by_status",
description: "Use this tool to list defect / safety-management records for a vessel that match one or more **currentStatus** values (e.g., \"READY OFFICE REVIEW\", \"OPEN\", \"CLOSED\"). You may also, if required, narrow the results further with a **stage** filter (OPEN, OPEN OVERDUE, or CLOSED).\n\nHow to use it\n1. Identify the vessel by its IMO number (or name).\n2. Select one or more **currentStatus** values from the enum values.\n3. (Optional) Provide a **stage** filter (\"OPEN\", \"OPEN OVERDUE\", or \"CLOSED\") if the user specifies one; otherwise omit it.\n4. Query the *defect* collection combining the vessel's `imo`, the chosen `currentStatus` value(s), and—if supplied—the `stage` value.\n5. Optionally set how many results you want per page.\n\nExample question: \"List defects which are **READY OFFICE REVIEW** for VESSEL_NAME.\" → use `imo = IMO_NUMBER`, `currentStatus = READY OFFICE REVIEW`.",
inputSchema: {
type: "object",
required: ["imo", "currentStatus"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
currentStatus: {
type: "string",
description: "Defect status to filter.",
enum: [
"AMENDED",
"APPROVED",
"ACCEPTED",
"CLOSED",
"CLOSURE VERIFICATION",
"DRAFT",
"OFFICE REVIEW IN PROGRESS",
"INVESTIGATION COMPLETED",
"IN PROGRESS",
"OPEN",
"PIC REVIEW IN PROGRESS",
"PENDING APPROVAL",
"RE-OPENED",
"READY OFFICE REVIEW",
"READY SHIP REVIEW",
"REGENERATE REPORT TYPE",
"REQUEST SUBMITTED SHORE",
"REQUEST SUBMITTED VESSEL",
"RETURNED",
"REQUESTED",
"REVIEW IN PROGRESS SHIP",
"REVIEW IN PROGRESS SHORE",
"REVIEW IN PROGRESS",
"SHIP REVIEW RETURNED",
"SEND BACK TO VESSEL",
"UNDER AMENDMENT",
"VERIFIED"
]
},
stage: {
type: "string",
enum: ["OPEN", "OPEN OVERDUE", "CLOSED"],
description: "Optional stage filter (omit to include all stages)."
},
per_page: {
type: "number",
description: "Number of records to return per page (default is 250)."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "get_all_vessel_defects_records",
description: "Whenever query is to retrieve all defect records for a vessel, Use this tool to export ALL defect records for a vessel from the defect typesense collection using the export method. Unlike defect search/table tools which have record limits, this tool retrieves the complete dataset of defect records for comprehensive defect analysis or inspection interval compliance. Optionally filter by date range using reportDate field for specific time periods. Use this when you need: complete defect history analysis, defect pattern identification, compliance audit data export, comprehensive defect tracking across time periods, recurring defect analysis, or when the user specifically asks for 'all' or 'complete' defect data. Use other defect tools instead when you need quick defect lookups, specific defect categories, or recent defect status checks. Example questions: 'Get all defects for VESSEL_NAME', 'Get complete defect history for last year for VESSEL_NAME', 'Download all defect records for VESSEL_NAME since January 2024', 'Show all recurring defects for VESSEL_NAME'.",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel"
},
start_date: {
type: "string",
description: "Optional start date for filtering defect records (YYYY-MM-DD format). Filter will include defects from this date onwards based on defectDate field"
},
end_date: {
type: "string",
description: "Optional end date for filtering defect records (YYYY-MM-DD format). Filter will include defects up to this date based on defectDate field"
}
},
additionalProperties: false
}
},
// {
// name: "get_vessel_details",
// description: "Retrieves vessel details including IMO number, vessel name, class, flag, DOC and the ERP version for a specific vessel.",
// inputSchema: {
// type: "object",
// properties: {
// query: {
// type: "string",
// description: "Pass the vessel name to search for the IMO number"
// }
// },
// required: ["query"],
// additionalProperties: false
// }
// },
// {
// name: "get_defect_table_schema",
// description: "This tool retrieves Typesense defect table schema and instructions on how to query the defect table for a specific category.",
// inputSchema: {
// type: "object",
// required: ["category"],
// properties: {
// category: {
// type: "string",
// description: "The category for which to retrieve the Typesense schema.",
// enum: ["defect"]
// }
// },
// additionalProperties: false
// }
// },
{
name: "get_tmsa_summary",
description: "This tool gives the recent TMSA checklist for the vessel, including date and time, in a downloadable format.",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "get_sire_reports_from_ocimf",
description: "Use this tool to get SIRE inspection status, days remaining, last inspection date, company, and report status of the vessel from OCIMF website. The reports are also available to download. It also provides recent SIRE inspection details, including date, company, location, vessel status, and validity.",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "fetch_fleet_historical_sire_observations",
description: "Use this tool to get the fleet's historical SIRE observations from OCIMF website. Example Question: Get me the SIRE observations received by the fleet",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
}
},
additionalProperties: false
}
},
{
name: "get_cdi_reports_from_ocimf",
description: "Use this tool to get last CDI inspection date, company, validity, days until next inspection, observations, report link, and questionnaires",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "get_vir_status_overview",
description: "Use this tool to get data from the VIR app and ShipPalm Defect module. It shows the next VIR due date, type (Port or Sailing), and a countdown of days remaining or overdue. It also includes details of the last VIR—date, type, number of defects raised, and their current status (Open/Closed/Overdue).",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "get_internal_audit_summary",
description: "use this tool to get summary of last Internal Audit which includes ISM, ISPS and Dynamic Navigational Audit , the dates when done and the defects. Also provides details to plan the next audit, like due date, number of days remaining etc.",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "get_psc_inspection_defects",
description: "use this tool to get last PSC inspection details and also historical record of PSC inspection dates.",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
{
name: "get_summary_of_defects",
description: "Use this tool to get list of defects from various sources like Ship Palm defect module, Class Websites, OCIMF Website, Various MOU websites are checked and a summary is prepared showing how many Overdue or coming due soon.",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
additionalProperties: false
}
},
// {
// name: "google_search",
// description: "Perform a Google search using a natural language query. Returns relevant web results.",
// inputSchema: {
// type: "object",
// required: ["query"],
// properties: {
// query: {
// type: "string",
// description: "The search query to be executed."
// }
// },
// additionalProperties: false
// }
// },
// {
// name: "parse_document_link",
// description: "Use this tool to parse a document link or a local file. The tool will parse the document and return the text content.",
// inputSchema: {
// type: "object",
// required: ["document_link"],
// properties: {
// document_link: {
// type: "string",
// description: "The link to the document that needs to be parsed"
// }
// },
// additionalProperties: false
// }
// },
// {
// name: "write_casefile_data",
// description: "Creates or updates casefile-related data. Supports two distinct operations:\n- write_casefile: Create or update casefile metadata (e.g., summary, title, importance).\n- write_page: Add or update a page under an existing casefile, including content and indexing. Only pass arguments explicitly required or allowed for the chosen operation.",
// inputSchema: {
// type: "object",
// properties: {
// operation: {
// type: "string",
// enum: ["write_casefile", "write_page"],
// description: "Specifies the writing operation: 'write_casefile' for creating new casefile or 'write_page' for page content of already existing casefile."
// },
// casefile_url: {
// type: "string",
// description: "The unique identifier of the casefile, direct casefile url link. Required for 'write_page'."
// },
// casefileName: {
// type: "string",
// enum: ["Internal Audit", "Sire", "VIR"],
// description: "Required for 'write_casefile'. Name of the casefile"
// },
// category: {
// type: "string",
// enum: ["internalAudit", "sire", "vir"],
// description: "Required for 'write_casefile'. Category of the casefile"
// },
// currentStatus: {
// type: "string",
// description: "<review the casefile and plan to create current status in one line, highlighting keywords> Required for 'write_casefile': Current status of the casefile, it will be of 4-5 words. Required for 'write_page': update or kept it same status of the casefile based on recent received email. it will be of 4-5 words."
// },
// casefileSummary: {
// type: "string",
// description: "Required for 'write_casefile'. Summary or high-level description of the casefile.\nOptional for 'write_page': can provide updated summary if needed."
// },
// importance: {
// type: "number",
// minimum: 0,
// maximum: 100,
// description: "It will show the importance of the casefile reference for the urgency and importance of the matter in the casefile. Required for 'write_casefile'. Importance score of the casefile (0–100).\nrequired for 'write_page': can provide an updated score based on the new email content added to the casefile."
// },
// imo: {
// type: "integer",
// description: "Required for 'write_casefile'. IMO number of the associated vessel."
// },
// role: {
// type: "string",
// enum: ["incident", "legal", "regulatory", "other"],
// description: "Required for 'write_casefile'. Role/category of the casefile."
// },
// summary: {
// type: "string",
// description: "Required for 'write_page'. Detailed content or summary of the new page."
// },
// topic: {
// type: "string",
// description: "Required for 'write_page'. It is of 4-8 words about what this document is about."
// },
// facts: {
// type: "string",
// description: "Required for 'write_page'. It will have the highlighted facts/information from the database."
// },
// detailed_report: {
// type: "string",
// description: "Required for 'write_page'. It will have the detailed report of the casefile in markdown format."
// },
// links: {
// type: "array",
// items: {
// type: "string"
// },
// description: "Required for 'write_page'. Relevant links you want to add to the case file."
// }
// },
// required: ["operation"],
// additionalProperties: false
// }
// },
// {
// name: "retrieve_casefile_data",
// description: "Retrieves data from casefiles. Supports the following operations:\n- get_casefiles: List all casefiles for a vessel matching a text query. Only pass arguments explicitly required or allowed for the chosen operation.",
// inputSchema: {
// type: "object",
// properties: {
// imo: {
// type: "integer",
// description: "Required for 'get_casefiles'. IMO number of the vessel."
// },
// query: {
// type: "string",
// description: "search query to filter casefiles based on the context and user query."
// },
// category: {
// type: "string",
// enum: ["internalAudit", "sire", "vir"],
// description: "Required for 'get_casefiles'. Category of the casefile."
// }
// },
// required: ["imo", "category", "query"],
// additionalProperties: false
// }
// }
];
//# sourceMappingURL=schema.js.map