defect-inspection-tools-mcp-server
Version:
118 lines (117 loc) • 9.55 kB
JavaScript
import { z } from "zod";
export const toolDefinitions = {
universal_defect_search: {
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.",
schema: {
query_by: z.string().optional().describe("Comma-separated list of field names to search in for full-text search. Only use string fields that are useful for text-based queries. Valid fields: vesselName, finding, referenceNumber, correctiveAction, riskCategory, inspectionType, reportType, currentStatus, stage, dataSource, inspectorName, location, description, remarks, rootCause, preventiveAction"),
q: z.string().default("*").describe("Search query string for full-text search. Use '*' for wildcard searches or specific terms. Example: 'maintenance defects' or 'pump*'"),
filter_by: z.string().optional().describe("Filter conditions using Typesense syntax. Use field:value format with operators like :, :>, :<, :>=, :<=. Combine with && (AND) or || (OR). Example: 'dataSource:SHIPPALM && currentStatus:Open'"),
sort_by: z.string().default("relevance").describe("Comma-separated list of fields with sort direction. Format: 'field:asc' or 'field:desc'. Example: 'defectDate:desc,vesselName:asc'"),
page: z.number().min(1).default(1).describe("Page number for pagination. Default: 1"),
per_page: z.number().min(1).max(250).default(50).describe("Number of results per page. Maximum: 250, Default: 50"),
}
},
get_all_vessel_defects_records: {
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'.",
schema: {
imo: z.string().describe("IMO number of the vessel"),
start_date: z.string().optional().describe("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: z.string().optional().describe("Optional end date for filtering defect records (YYYY-MM-DD format). Filter will include defects up to this date based on defectDate field")
}
},
get_tmsa_summary: {
name: "get_tmsa_summary",
description: "This tool gives the recent TMSA checklist for the vessel, including date and time, in a downloadable format.",
schema: {
imo: z.string().describe("IMO number of the vessel.")
}
},
get_sire_reports_from_ocimf: {
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.",
schema: {
imo: z.string().describe("IMO number of the vessel.")
}
},
fetch_fleet_historical_sire_observations: {
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",
schema: {
fleet_imo: z.string().describe("IMO number of the fleet.")
}
},
get_cdi_reports_from_ocimf: {
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",
schema: {
imo: z.string().describe("IMO number of the vessel.")
}
},
get_vir_status_overview: {
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).",
schema: {
imo: z.string().describe("IMO number of the vessel.")
}
},
get_internal_audit_summary: {
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.",
schema: {
imo: z.string().describe("IMO number of the vessel.")
}
},
get_psc_inspection_defects: {
name: "get_psc_inspection_defects",
description: "use this tool to get last PSC inspection details and also historical record of PSC inspection dates.",
schema: {
imo: z.string().describe("IMO number of the vessel.")
}
},
get_summary_of_defects: {
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.",
schema: {
imo: z.string().describe("IMO number of the vessel.")
}
},
get_fleet_sire_cdi_inspection_status: {
name: "get_fleet_sire_cdi_inspection_status",
description: "Use this tool to get the information on SIRE and CDI inspection status overview for all vessels in the fleet",
schema: {
fleet_imo: z.string().describe("The IMO number of the fleet.")
}
},
get_fleet_vir_status_overview: {
name: "get_fleet_vir_status_overview",
description: "Use this tool to get the information on VIR status overview for all vessels in the fleet",
schema: {
fleet_imo: z.string().describe("The IMO number of the fleet.")
}
},
get_fleet_last_internal_audit_summary: {
name: "get_fleet_last_internal_audit_summary",
description: "Use this tool to get the information on last internal audit summary for all vessels in the fleet",
schema: {
fleet_imo: z.string().describe("The IMO number of the fleet.")
}
},
export_fleet_defects: {
name: "export_fleet_defects",
description: "Export ALL defect records for an entire fleet in CSV format. The tool performs the following steps: 1) Queries MongoDB common_group_details collection using the provided fleet IMO to get the list of vessel IMO numbers in the fleet, 2) Uses Typesense export to retrieve all defects for all vessels in the fleet, 3) Converts the data to CSV format for analysis. This tool is ideal for comprehensive fleet-wide defect analysis, compliance reporting, and bulk data export. The fleet IMO should be obtained from another MCP server that handles fleet name lookups.",
schema: {
fleet_imo: z.number().describe("IMO number of the fleet or group (e.g., 1000017 for SMPL DRY fleet). This should be obtained from a fleet lookup service."),
start_date: z.string().optional().describe("Optional start date for filtering defect records (YYYY-MM-DD format). Filter will include defects from this date onwards based on reportDate field"),
end_date: z.string().optional().describe("Optional end date for filtering defect records (YYYY-MM-DD format). Filter will include defects up to this date based on reportDate field"),
}
},
get_pending_sire_operator_comments: {
name: "get_pending_sire_operator_comments",
description: "Track SIRE inspection operator comment deadlines. Check if a vessel (by IMO) has completed inspection and needs operator comments, or get all vessels awaiting operator comments. Calculates days since inspection and reminds about the 14-day comment deadline.",
schema: {
imo: z.number().optional().describe("IMO number of the vessel to check (optional - if not provided, returns all vessels awaiting operator comments)")
}
}
};