Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/server/mcp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
async () => ({
content: [
{
type: 'text' as const,
type: 'text',
text: 'Test response'
}
]
Expand Down Expand Up @@ -694,7 +694,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
async () => ({
content: [
{
type: 'text' as const,
type: 'text',
text: 'Test response'
}
]
Expand Down Expand Up @@ -876,7 +876,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
}
},
async () => ({
content: [{ type: 'text' as const, text: 'Test response' }]
content: [{ type: 'text', text: 'Test response' }]
})
);

Expand Down Expand Up @@ -1928,7 +1928,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
{
description: 'A valid tool name'
},
async () => ({ content: [{ type: 'text' as const, text: 'Success' }] })
async () => ({ content: [{ type: 'text', text: 'Success' }] })
);

// Test tool name with warnings (starts with dash)
Expand All @@ -1937,7 +1937,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
{
description: 'A tool name that generates warnings'
},
async () => ({ content: [{ type: 'text' as const, text: 'Success' }] })
async () => ({ content: [{ type: 'text', text: 'Success' }] })
);

// Test invalid tool name (contains spaces)
Expand All @@ -1946,7 +1946,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
{
description: 'An invalid tool name'
},
async () => ({ content: [{ type: 'text' as const, text: 'Success' }] })
async () => ({ content: [{ type: 'text', text: 'Success' }] })
);

// Verify that warnings were issued (both for warnings and validation failures)
Expand Down Expand Up @@ -3894,7 +3894,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {

// Tool 1: Only name
mcpServer.tool('tool_name_only', async () => ({
content: [{ type: 'text' as const, text: 'Response' }]
content: [{ type: 'text', text: 'Response' }]
}));

// Tool 2: Name and annotations.title
Expand All @@ -3905,7 +3905,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
title: 'Annotations Title'
},
async () => ({
content: [{ type: 'text' as const, text: 'Response' }]
content: [{ type: 'text', text: 'Response' }]
})
);

Expand All @@ -3917,7 +3917,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
description: 'Tool with regular title'
},
async () => ({
content: [{ type: 'text' as const, text: 'Response' }]
content: [{ type: 'text', text: 'Response' }]
})
);

Expand All @@ -3932,7 +3932,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
}
},
async () => ({
content: [{ type: 'text' as const, text: 'Response' }]
content: [{ type: 'text', text: 'Response' }]
})
);

Expand Down Expand Up @@ -5009,7 +5009,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
description: 'Tool with regular title'
},
async () => ({
content: [{ type: 'text' as const, text: 'Response' }]
content: [{ type: 'text', text: 'Response' }]
})
);

Expand All @@ -5024,7 +5024,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
}
},
async () => ({
content: [{ type: 'text' as const, text: 'Response' }]
content: [{ type: 'text', text: 'Response' }]
})
);

Expand Down
2 changes: 1 addition & 1 deletion src/server/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ export class McpServer {
/**
* Registers a tool with a config object and callback.
*/
registerTool<InputArgs extends ZodRawShapeCompat | AnySchema, OutputArgs extends ZodRawShapeCompat | AnySchema>(
registerTool<OutputArgs extends ZodRawShapeCompat | AnySchema, InputArgs extends undefined | ZodRawShapeCompat | AnySchema = undefined>(
name: string,
config: {
title?: string;
Expand Down
Loading