survey-mcp-server
Version:
Survey management server handling survey creation, response collection, analysis, and reporting with database access for data management
741 lines • 33.1 kB
JavaScript
export const listToolsRequestSchema = {
type: "object",
properties: {
category: {
type: "string",
description: "Optional category to filter tools by",
enum: ["survey", "response", "analytics", "template"]
},
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_certificate_survey_search",
description: "Comprehensive fallback search tool for vessel certificates, surveys, and compliance documents. Use this tool when specific focused tools fail to return satisfactory results or when you need flexible, multi-criteria searching across all record types (CERTIFICATE, CMS, COC, IHM, SURVEY). Supports natural language queries, complex filtering, and custom sorting. This universal tool can handle any certificate or survey-related query but should be used as a secondary option after trying more targeted tools first.",
inputSchema: {
type: "object",
properties: {
query: {
type: "string",
description: "Natural language or keyword query. This is matched against the fields certificateSurveyEquipmentName and issuingAuthority. Use '*' to match 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"
},
type: {
type: "string",
description: "Type of records to be returned, CERTIFICATE for certificates, CMS for continuous machinery survey, COC for condition of class, IHM for inventory of hazardous materials, SURVEY for survey",
enum: ["CERTIFICATE", "CMS", "COC", "IHM", "SURVEY"]
},
certificateSurveyEquipmentName: {
type: "string",
description: "Exact scope or equipment name related to the certificate"
},
issuingAuthority: {
type: "string",
description: "Authority that issued the certificate (e.g., 'DNV', 'ABS')"
},
certificateNumber: {
type: "string",
description: "Exact certificate number"
},
currentStatus: {
type: "string",
description: "Current lifecycle status of the certificate",
enum: ["IN ORDER", "IN WINDOW", "EXPIRED"]
},
isExtended: {
type: "boolean",
description: "Filter for certificates that have been extended"
},
dataSource: {
type: "string",
description: "Data source for the certificate, MMPL and Shippalm are company ERP systems, Class is the classification society",
enum: ["Class", "MMPL", "ShippalmV2", "ShippalmV3"]
},
daysToExpiry_range: {
type: "object",
description: "Filter by number of days remaining until expiry (negative values include expired)",
properties: {
min_days: {
type: "number",
description: "Minimum days until expiry"
},
max_days: {
type: "number",
description: "Maximum days until expiry"
}
}
},
issueDate_range: {
type: "object",
description: "Filter by issue date of the certificate",
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)"
}
}
},
expiryDate_range: {
type: "object",
description: "Filter by expiry date of the certificate",
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", "expiryDate", "issueDate", "daysToExpiry"],
default: "relevance"
},
sort_order: {
type: "string",
description: "Sorting order of the results",
enum: ["asc", "desc"],
default: "asc"
},
max_results: {
type: "number",
description: "Maximum number of results to return",
default: 10,
minimum: 1,
maximum: 100
}
},
required: ["query"],
additionalProperties: false
}
},
{
name: "list_extended_certificate_records",
description: "Use this tool to get the list of certificate-related records for a vessel that have been **officially extended** (that is, `isExtended=true`). 1. Read the vessel's IMO (or name) from the user's request. 2. Optionally read one or more record **types** to narrow the search. Valid values are: CERTIFICATE, CMS, COC, IHM, SURVEY. If no type is supplied the tool will return all types. 3. Query the *certificate* collection combining the vessel's `imo`, the fixed filter `isExtended:true`, and—if provided—the `type` filter from step 2. 4. Optionally let the caller specify how many results to show per page. Example question: 'Give me a list of surveys, CoC, IHM, CMS or certificates for VESSEL_NAME that have been extended.'",
inputSchema: {
type: "object",
required: ["imo"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel"
},
recordType: {
type: "array",
items: {
type: "string",
enum: ["CERTIFICATE", "CMS", "COC", "IHM", "SURVEY"]
},
description: "Optional record type (use one of the enum values; omit to include all types). Multiple types to be given as comma separated values"
},
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_records_expiring_within_days",
description: "Use this tool to get the list of **certificate-related records** (CERTIFICATE, CMS/CSM, COC, IHM, or SURVEY) for a vessel that will expire within the next **N days**. 1. Read the vessel's IMO (or name) and the desired record **type** from the user's request. The type must be one of the allowed enum values: CERTIFICATE, CMS, COC, IHM, SURVEY. 2. Read the day horizon **X** (e.g., 90) and apply the filter `daysToExpiry:<N` so only records whose expiry or due date is less than N days away are returned. 3. Query the *certificate* collection with three combined filters: the vessel's `imo`, the selected `type`, and the `daysToExpiry` limit from step 2. 4. Optionally let the caller specify how many results to show per page. Example question: 'Show all Certificate items that will expire in the next 90 days for VESSEL_NAME.'",
inputSchema: {
type: "object",
required: ["imo", "recordType", "daysToExpiry"],
properties: {
imo: {
type: "string",
description: "IMO number of the vessel"
},
recordType: {
type: "array",
items: {
type: "string",
enum: ["CERTIFICATE", "CMS", "COC", "IHM", "SURVEY"]
},
description: "Record type to filter. Multiple types to be given as comma separated values"
},
daysToExpiry: {
type: "number",
description: "Number of days remaining for certificate, survey, CMS or COC to expire. Upper limit in days (X) for the remaining time to expire"
},
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_records_by_status",
description: "Return survey, certificate, or continuous-machinery-survey (CSM/CMS) records for one or more vessels whose `status` matches specific life-cycle states (e.g., EXPIRED or IN_WINDOW). **How to invoke** 1. Populate `imo` with at least one seven-digit integer (IMO number). 2. Select one or more `recordType` values [CERTIFICATE, CSM, COC, IHM, SURVEY]. 3. Select one or more `status` values [EXPIRED, IN_WINDOW, IN_ORDER]. 4. (Optional) Tune `perPage` (default = 250, max = 500). All supplied filters are combined with logical AND semantics.",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "IMO number for the target vessel."
},
recordType: {
type: "array",
items: {
type: "string",
enum: ["CERTIFICATE", "CSM", "COC", "IHM", "SURVEY"]
},
description: "Record category filter. Multiple selections permitted."
},
status: {
type: "array",
items: {
type: "string",
enum: ["IN_ORDER", "IN_WINDOW", "EXPIRED"]
},
description: "Lifecycle state filter for the record."
},
perPage: {
type: "number",
minimum: 1,
maximum: 500,
default: 250,
description: "Upper bound on records returned per page."
},
session_id: {
type: "string",
description: "Session ID for tracking client sessions, if available"
}
},
required: ["imo", "recordType"],
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_user_associated_vessels",
// description: "Retrieves a list of vessels associated with a specific user (by email).",
// inputSchema: {
// type: "object",
// properties: {
// mailId: {
// type: "string",
// description: "The email address of the user to find associated vessels for."
// }
// },
// required: ["mailId"],
// additionalProperties: false
// }
// },
// {
// name: "get_class_survey_report",
// description: "Retrieves Class Survey Status Report pdf link for a specific vessel.",
// inputSchema: {
// type: "object",
// properties: {
// imo: {
// type: "string",
// description: "The IMO number of the vessel."
// }
// },
// required: ["imo"],
// additionalProperties: false
// }
// },
{
name: "get_class_certificate_status",
description: "Use this tool to get an overview of a vessel's statutory certificates based on data from Class website. It informs whether all certificates are in order or if any are due or overdue.",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the vessel."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_class_survey_status",
description: "Use this tool to get an overview of a vessel's statutory surveys based on data from the Class website. It informs whether all surveys are in order or if any are due, in window or overdue.",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the vessel."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_coc_notes_memo_status",
description: "Use this tool to get details of CoCs, notes, and memos for the vessel including issue date, due date and status from Class Website.",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the vessel."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_vessel_dry_docking_status",
description: "Use this tool to get the information on Next periodical survey (Annual/Intermediate/Special) due date, type of survey, window period, remaining days etc.",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the vessel."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_next_periodical_survey_details",
description: "Retrieves Next Periodical Survey details for a specific vessel.",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the vessel."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_cms_items_status",
description: "Use this tool to get an overview of a vessel's CMS (Continuous Survey of Machinery) items based on data from Class website. It informs whether all CMS Items are in order or if any are due or overdue.",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the vessel."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_expired_certificates_from_shippalm",
description: "Use this tool to get an overview of a vessel's certificates based on data from the ERP system, Ship Palm. It informs whether all certificates are in order or if any are due or overdue.",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the vessel."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_fleet_dry_docking_status",
description: "Use this tool to get the information on dry docking status of all vessels in the fleet",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the fleet."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_fleet_annual_survey_status",
description: "Use this tool to get the information on annual survey status of all vessels in the fleet",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the fleet."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_fleet_ihm_certificate_status",
description: "Use this tool to get the information on IHM Certificate status of all vessels in the fleet",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the fleet."
}
},
required: ["imo"],
additionalProperties: false
}
},
{
name: "get_fleet_lsa_ffa_certificate_status",
description: "Use this tool to get the information on LSA/FFA Certificate status of all vessels in the fleet",
inputSchema: {
type: "object",
properties: {
imo: {
type: "string",
description: "The IMO number of the fleet."
}
},
required: ["imo"],
additionalProperties: false
}
},
// {
// name: "get_vessel_class_by_imo",
// description: "Fetch the class (classification society) recorded for a vessel. The tool looks up the document whose `imo` field matches the supplied IMO number in the Typesense collection `fleet-vessel-lookup`, and returns the value of its `class` field (plus the IMO for reference).",
// inputSchema: {
// type: "object",
// required: ["imo"],
// properties: {
// imo: {
// type: "number",
// description: "IMO number of the vessel."
// }
// },
// 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: "class_ccs_survey_status_download",
description: "Downloads Survey Status Report from CCS website for a vessel and returns download path",
inputSchema: {
type: "object",
properties: {
vessel_name: {
type: "string",
description: "Name of the vessel"
},
doc: {
type: "string",
description: "It is the group to which the vessel belongs in the company."
}
},
required: ["vessel_name", "doc"],
additionalProperties: false
}
},
{
name: "class_nk_survey_status_download",
description: "Downloads Survey Status Report from NK website for a vessel and returns download path",
inputSchema: {
type: "object",
properties: {
vessel_name: {
type: "string",
description: "Name of the vessel"
},
doc: {
type: "string",
description: "It is the group to which the vessel belongs in the company."
}
},
required: ["vessel_name", "doc"],
additionalProperties: false
}
},
{
name: "class_kr_survey_status_download",
description: "Downloads Survey Status Report from KR website for a vessel and returns download path",
inputSchema: {
type: "object",
properties: {
vessel_name: {
type: "string",
description: "Name of the vessel"
},
doc: {
type: "string",
description: "It is the group to which the vessel belongs in the company."
}
},
required: ["vessel_name", "doc"],
additionalProperties: false
}
},
{
name: "class_dnv_survey_status_download",
description: "Downloads Survey Status Report from DNV website for a vessel and returns download path",
inputSchema: {
type: "object",
properties: {
vessel_name: {
type: "string",
description: "Name of the vessel"
},
doc: {
type: "string",
description: "It is the group to which the vessel belongs in the company."
}
},
required: ["vessel_name", "doc"],
additionalProperties: false
}
},
{
name: "class_lr_survey_status_download",
description: "Downloads Survey Status Report from LR website for a vessel and returns download path",
inputSchema: {
type: "object",
properties: {
vessel_name: {
type: "string",
description: "Name of the vessel"
},
doc: {
type: "string",
description: "It is the group to which the vessel belongs in the company."
}
},
required: ["vessel_name", "doc"],
additionalProperties: false
}
},
{
name: "class_bv_survey_status_download",
description: "Downloads Survey Status Report from BV website for a vessel and returns download path",
inputSchema: {
type: "object",
properties: {
vessel_name: {
type: "string",
description: "Name of the vessel"
},
doc: {
type: "string",
description: "It is the group to which the vessel belongs in the company."
}
},
required: ["vessel_name", "doc"],
additionalProperties: false
}
},
{
name: "class_abs_survey_status_download",
description: "Downloads Survey Status Report from ABS website for a vessel and returns download path",
inputSchema: {
type: "object",
properties: {
vessel_name: {
type: "string",
description: "Name of the vessel"
},
doc: {
type: "string",
description: "It is the group to which the vessel belongs in the company."
}
},
required: ["vessel_name", "doc"],
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: ["Class Survey and Certificate Status"],
// description: "Required for 'write_casefile'. Name of the casefile"
// },
// category: {
// type: "string",
// enum: ["classSurveyAndCertificateStatus"],
// 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.\nOnly 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: ["classSurveyAndCertificateStatus"],
// description: "Required for 'get_casefiles'. Category of the casefile."
// }
// },
// required: ["imo", "category", "query"],
// additionalProperties: false
// }
// }
];
//# sourceMappingURL=schema.js.map