Skip to content

feat: generate schemas from types, improve type definitions #2854

feat: generate schemas from types, improve type definitions

feat: generate schemas from types, improve type definitions #2854

Triggered via pull request December 13, 2025 14:45
Status Failure
Total duration 38s
Artifacts

main.yml

on: pull_request
Matrix: test
publish
0s
publish
Fit to window
Zoom out
Zoom in

Annotations

27 errors
build
Process completed with exit code 2.
build: test/shared/protocol.test.ts#L3811
Expected 2-3 arguments, but got 1.
build: test/shared/protocol.test.ts#L3731
Expected 2-3 arguments, but got 1.
build: test/shared/protocol.test.ts#L3684
Expected 2-3 arguments, but got 1.
build: test/shared/protocol.test.ts#L2304
Expected 2-3 arguments, but got 1.
build: test/shared/protocol.test.ts#L2089
Expected 2-3 arguments, but got 1.
build: test/integration-tests/taskLifecycle.test.ts#L1043
Expected 2-3 arguments, but got 1.
test/client/index.test.ts > Task-based execution > Client calling server > should query task list from server using listTasks: src/server/zod-compat.ts#L85
$ZodError: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ new $ZodError node_modules/zod/v4/core/core.js:39:39 ❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20 ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1174:41 ❯ Client._onresponse src/shared/protocol.ts:903:13 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:790:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', difference: 'Function<difference>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', intersection: 'Function<intersection>', isSubsetOf: 'Function<isSubsetOf>', isSupersetOf: 'Function<isSupersetOf>', isDisjointFrom: 'Function<isDisjointFrom>', size: 1, symmetricDifference: 'Function<symmetricDifference>', union: 'Function<union>', values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
test/client/index.test.ts > Task-based execution > Client calling server > should query task status from server using getTask: src/server/zod-compat.ts#L85
$ZodError: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ new $ZodError node_modules/zod/v4/core/core.js:39:39 ❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20 ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1174:41 ❯ Client._onresponse src/shared/protocol.ts:903:13 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:790:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', difference: 'Function<difference>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', intersection: 'Function<intersection>', isSubsetOf: 'Function<isSubsetOf>', isSupersetOf: 'Function<isSupersetOf>', isDisjointFrom: 'Function<isDisjointFrom>', size: 1, symmetricDifference: 'Function<symmetricDifference>', union: 'Function<union>', values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
test/client/index.test.ts > Task-based execution > Client calling server > should create task on server via tool call: src/server/zod-compat.ts#L85
$ZodError: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ new $ZodError node_modules/zod/v4/core/core.js:39:39 ❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20 ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1174:41 ❯ Client._onresponse src/shared/protocol.ts:903:13 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:790:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', difference: 'Function<difference>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', intersection: 'Function<intersection>', isSubsetOf: 'Function<isSubsetOf>', isSupersetOf: 'Function<isSupersetOf>', isDisjointFrom: 'Function<isDisjointFrom>', size: 1, symmetricDifference: 'Function<symmetricDifference>', union: 'Function<union>', values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
test/client/index.test.ts > outputSchema validation > should fail validation with additional properties when not allowed: test/client/index.test.ts#L2332
AssertionError: expected [Function] to throw error matching /Structured content does not match the…/ but got 'MCP error -32602: MCP error -32602: I…' - Expected: /Structured content does not match the tool's output schema/ + Received: "MCP error -32602: MCP error -32602: Invalid tools/call result: [ { \"expected\": \"array\", \"code\": \"invalid_type\", \"path\": [ \"content\" ], \"message\": \"Invalid input: expected array, received undefined\" } ]" ❯ test/client/index.test.ts:2332:9
test/client/index.test.ts > outputSchema validation > should handle complex JSON schema validation: src/types.ts#L706
McpError: MCP error -32602: MCP error -32602: Invalid tools/call result: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ McpError.fromError src/types.ts:706:16 ❯ Client._onresponse src/shared/protocol.ts:905:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:821:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32602, data: undefined }
test/client/index.test.ts > outputSchema validation > should throw error when structuredContent does not match schema: test/client/index.test.ts#L1963
AssertionError: expected [Function] to throw error matching /Structured content does not match the…/ but got 'MCP error -32602: MCP error -32602: I…' - Expected: /Structured content does not match the tool's output schema/ + Received: "MCP error -32602: MCP error -32602: Invalid tools/call result: [ { \"expected\": \"array\", \"code\": \"invalid_type\", \"path\": [ \"content\" ], \"message\": \"Invalid input: expected array, received undefined\" } ]" ❯ test/client/index.test.ts:1963:9
test/client/index.test.ts > outputSchema validation > should validate structuredContent against outputSchema: src/types.ts#L706
McpError: MCP error -32602: MCP error -32602: Invalid tools/call result: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ McpError.fromError src/types.ts:706:16 ❯ Client._onresponse src/shared/protocol.ts:905:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:821:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32602, data: undefined }
test/types.test.ts > Types > ToolResultContent > should validate tool result with error in content: test/types.test.ts#L579
AssertionError: expected false to be true // Object.is equality - Expected + Received - true + false ❯ test/types.test.ts:579:36
test/types.test.ts > Types > ToolResultContent > should validate a tool result content: test/types.test.ts#L562
AssertionError: expected false to be true // Object.is equality - Expected + Received - true + false ❯ test/types.test.ts:562:36
test/types.test.ts > Types > CallToolResult with ContentBlock > should validate empty content array with default: test/types.test.ts#L286
AssertionError: expected false to be true // Object.is equality - Expected + Received - true + false ❯ test/types.test.ts:286:36
test/client/index.test.ts > Task-based execution > Client calling server > should query task list from server using listTasks: src/server/zod-compat.ts#L85
$ZodError: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ new $ZodError node_modules/zod/v4/core/core.js:39:39 ❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20 ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1174:41 ❯ Client._onresponse src/shared/protocol.ts:903:13 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:790:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', size: 1, values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
test/client/index.test.ts > Task-based execution > Client calling server > should query task status from server using getTask: src/server/zod-compat.ts#L85
$ZodError: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ new $ZodError node_modules/zod/v4/core/core.js:39:39 ❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20 ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1174:41 ❯ Client._onresponse src/shared/protocol.ts:903:13 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:790:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', size: 1, values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
test/client/index.test.ts > Task-based execution > Client calling server > should create task on server via tool call: src/server/zod-compat.ts#L85
$ZodError: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ new $ZodError node_modules/zod/v4/core/core.js:39:39 ❯ Module.<anonymous> node_modules/zod/v4/core/parse.js:40:20 ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1174:41 ❯ Client._onresponse src/shared/protocol.ts:903:13 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ Promise.resolve.then.then.then.errorResponse.jsonrpc src/shared/protocol.ts:790:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { _zod: { def: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ], constr: 'Function<$ZodError>', traits: { constructor: 'Function<Set>', has: 'Function<has>', add: 'Function<add>', delete: 'Function<delete>', clear: 'Function<clear>', entries: 'Function<entries>', forEach: 'Function<forEach>', size: 1, values: 'Function<values>', keys: 'Function<values>' }, deferred: [] }, issues: [ { expected: 'array', code: 'invalid_type', path: [ 'content' ], message: 'Invalid input: expected array, received undefined' } ] }
test/client/index.test.ts > outputSchema validation > should fail validation with additional properties when not allowed: test/client/index.test.ts#L2332
AssertionError: expected [Function] to throw error matching /Structured content does not match the…/ but got 'MCP error -32602: MCP error -32602: I…' - Expected: /Structured content does not match the tool's output schema/ + Received: "MCP error -32602: MCP error -32602: Invalid tools/call result: [ { \"expected\": \"array\", \"code\": \"invalid_type\", \"path\": [ \"content\" ], \"message\": \"Invalid input: expected array, received undefined\" } ]" ❯ test/client/index.test.ts:2332:9
test/client/index.test.ts > outputSchema validation > should handle complex JSON schema validation: src/types.ts#L706
McpError: MCP error -32602: MCP error -32602: Invalid tools/call result: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ Function.fromError src/types.ts:706:16 ❯ Client._onresponse src/shared/protocol.ts:905:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:821:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32602, data: undefined }
test/client/index.test.ts > outputSchema validation > should throw error when structuredContent does not match schema: test/client/index.test.ts#L1963
AssertionError: expected [Function] to throw error matching /Structured content does not match the…/ but got 'MCP error -32602: MCP error -32602: I…' - Expected: /Structured content does not match the tool's output schema/ + Received: "MCP error -32602: MCP error -32602: Invalid tools/call result: [ { \"expected\": \"array\", \"code\": \"invalid_type\", \"path\": [ \"content\" ], \"message\": \"Invalid input: expected array, received undefined\" } ]" ❯ test/client/index.test.ts:1963:9
test/client/index.test.ts > outputSchema validation > should validate structuredContent against outputSchema: src/types.ts#L706
McpError: MCP error -32602: MCP error -32602: Invalid tools/call result: [ { "expected": "array", "code": "invalid_type", "path": [ "content" ], "message": "Invalid input: expected array, received undefined" } ] ❯ Function.fromError src/types.ts:706:16 ❯ Client._onresponse src/shared/protocol.ts:905:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:625:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:821:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32602, data: undefined }
test/types.test.ts > Types > ToolResultContent > should validate tool result with error in content: test/types.test.ts#L579
AssertionError: expected false to be true // Object.is equality - Expected + Received - true + false ❯ test/types.test.ts:579:36
test/types.test.ts > Types > ToolResultContent > should validate a tool result content: test/types.test.ts#L562
AssertionError: expected false to be true // Object.is equality - Expected + Received - true + false ❯ test/types.test.ts:562:36
test/types.test.ts > Types > CallToolResult with ContentBlock > should validate empty content array with default: test/types.test.ts#L286
AssertionError: expected false to be true // Object.is equality - Expected + Received - true + false ❯ test/types.test.ts:286:36