Skip to main content
Version: v0.1.10

MCP tools

The tools cosyte-mcp lists on tools/list. Each tool declares an input schema and an output schema, and every reply conforms to its tool's output schema. To register the server, see Connect an agent with the MCP server.

Tools​

ToolTitleInputRuns
parseParse a healthcare messagecontent (required), formatcosyte parse - --json
validateValidate a healthcare messagecontent (required), formatcosyte validate - --json
inspectInspect a healthcare message's structurecontent (required), formatcosyte inspect - --json
convertConvert HL7 v2 to a FHIR R4 Bundlecontent (required), tocosyte convert - --to fhir --json
  • content is the message as text, fed to the command as if it were piped on stdin.
  • format is one of hl7, fhir, dicom, x12, ccda, ncpdp, astm, mllp; leave it out to detect the format from the content. A format whose parser does not support the tool's operation answers CLI_FORMAT_UNSUPPORTED (see Format support).
  • to is fhir, the only target, and the default.
  • The input schema declares no other property (additionalProperties: false); the server ignores any other property it is sent.

Result properties​

Every reply's structured content has these properties:

PropertyTypePresentMeaning
okbooleanalwaystrue when the call produced data, a negative verdict included.
statusstringalwayssuccess, verdict, or failed.
exitintegeralwaysThe exit code the command ended with; see Exit codes.
codestringon failedThe diagnostic code; see Diagnostic codes.
dataobjectunless failedThe tool's payload, below.
statusokMarked as an errorWhen
successtruenoThe command exited 0.
verdicttruenoThe command produced output and exited non-zero: an invalid message from validate, an error-severity finding from convert, or a failed record in a parse stream.
failedfalseyesThe command produced no output: a usage error, input it could not read or parse, a missing library, or an internal error.

The reply's text content is the same structured object, serialized as JSON. An unknown tool name, or a call without a string content, is failed with CLI_USAGE and exit 2, and echoes neither.

Payloads​

Tooldata
parse{ format, model, warnings } for one message; { records } for a multi-record input such as an MLLP stream, one entry per record.
validate{ format, valid, findings }. Each finding is { code, severity, location }.
inspect{ format, ... }: the format's counts and type codes, as cosyte inspect --json prints them.
convert{ format, bundle, findings }: format is fhir, bundle the FHIR R4 Bundle.

Example​

A validate call on a Patient whose gender is not in its value set:

{
"ok": true,
"status": "verdict",
"exit": 1,
"data": {
"format": "fhir",
"valid": false,
"findings": [{ "code": "CODE_INVALID", "severity": "error", "location": "Patient.gender" }]
}
}

Not offered​

redact, map-codes, fmt, and completion are not tools, and there is no tool option for --unsafe-show-values.

In the API reference​

TOOL_DEFS, McpStructuredResult, McpToolStatus, and dispatchTool.