Skip to content

Suite spec ​

This document lists every field of the JSON suite that mcpeak test reads, with its type. For how to write one, see writing suites.

Suite ​

json
{
  "schemaVersion": 1,
  "id": "weather",
  "name": "날씨 서버",
  "approval": { "fingerprint": "…", "cases": [] },
  "defaultTimeoutMs": 10000,
  "cases": []
}
FieldTypeRequiredMeaning
schemaVersion1yesThe suite format version. Any other value gives UNSUPPORTED_SCHEMA_VERSION
idstringyesThe suite identifier
namestringyesPrinted on the first line of the report
approvalobjectnoThe approval block attached by generate. Absent from a hand written suite
defaultTimeoutMsnumbernoThe default time limit for a case. 10 seconds if absent
casesarrayyesOne or more. Empty gives EMPTY_CASES

A field not on this list is rejected with UNKNOWN_FIELD, so a typo does not get silently ignored.

approval ​

FieldTypeMeaning
fingerprintstringA digest of the suite at the time it was approved. 64 lowercase hex characters. Computed from the parsed object, so it is unaffected by indentation or key order. approval itself is excluded from the computation
cases[]{ id, status }The classification from the dry run. status is either passed or serverDefect

Case ​

json
{
  "id": "seoul-succeeds",
  "name": "서울 날씨를 정상 조회한다",
  "timeoutMs": 5000,
  "operation": { "type": "callTool", "tool": "get_weather", "input": { "city": "서울" } },
  "assertions": [{ "type": "isError", "expected": false }]
}
FieldTypeRequiredMeaning
idstringyesUnique within the suite. A duplicate gives DUPLICATE_CASE_ID
namestringyesPrinted on the case's line in the report
timeoutMsnumbernoThe time limit for this case. Takes priority over defaultTimeoutMs
operationobjectyesOne of the two forms below
assertionsarrayyesOne or more. Empty gives EMPTY_ASSERTIONS

Operation ​

typeOther fieldsMeaning
listToolsnoneCalls the server's tools/list
callTooltool: string, input: objectCalls a tool with that input. input must be a JSON object

Assertion ​

Each operation has a fixed set of assertions it can take. A mismatch gives INCOMPATIBLE_ASSERTION.

typeOperationOther fieldsMeaning
toolExistslistToolstool: stringA tool with that name is in the list
isErrorcallToolexpected: booleanThe response's isError equals that value
bodyMatchesSchemacallToolschemaThe response's text body (parsed as JSON if it is JSON) matches the schema
structuredContentMatchesSchemacallToolschemaThe response's structuredContent matches the schema

Response schema ​

The subset of JSON Schema accepted by the two schema assertions. A keyword outside this list is rejected with UNSUPPORTED_SCHEMA_KEYWORD.

KeywordTypeMeaning
typeobject / array / string / number / integer / boolean / nullThe value's type. Only one
constJSON valueExactly this value
enumarray of JSON valuesOne of these
requiredstring[]Properties that must be present
propertiesschema mapThe schema for each property
additionalPropertiesboolean or schemaIf false, rejects fields outside properties
itemsschemaThe schema for array elements
minItemsnumberMinimum array length
minLength / maxLengthnumberString length
stringContainsstringThe string contains this substring. Not a standard keyword
minimum / maximumnumberNumeric range

A keyword whose meaning depends on the type must be accompanied by that type. minLength with no type gives SCHEMA_KEYWORD_REQUIRES_TYPE.

Validation errors ​

If the suite is malformed, the run stops before the server is started, and each problem is reported with a code, path, message, and hint.

CodeMeaning
MISSING_REQUIRED_FIELDA required field is missing
UNKNOWN_FIELDA field outside the list is present
UNSUPPORTED_SCHEMA_VERSIONschemaVersion is not 1
INVALID_TYPE / INVALID_VALUEA field's type or value is wrong
DUPLICATE_CASE_IDA case id is duplicated
EMPTY_CASES / EMPTY_ASSERTIONSAn array is empty
INCOMPATIBLE_ASSERTIONAn assertion does not match its operation
INVALID_JSON_VALUEinput, const, or enum holds a non JSON value
INVALID_TIMEOUTThe time limit is not a positive integer
UNSUPPORTED_SCHEMA_KEYWORDThe response schema has an unsupported keyword
SCHEMA_KEYWORD_REQUIRES_TYPEA keyword is missing the type it requires

TypeScript types ​

@mcpeak/runner exports the same format as TestSuiteSpec. defineMcpSuite validates while preserving literal types, and validateMcpSuite validates external JSON and returns either { valid, value } or { valid, issues }.