feat: add optional resource annotations (#954)

Co-authored-by: Konstantin Konstantinov <konstantin@mach5technology.com>
This commit is contained in:
Vincent Horvath 2025-12-03 00:22:20 -05:00 • committed by GitHub
commit 4b5c25d592
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2315,12 +2315,18 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
version: '1.0'
});
const mockDate = new Date().toISOString();
mcpServer.resource(
'test',
'test://resource',
{
description: 'Test resource',
mimeType: 'text/plain'
mimeType: 'text/plain',
annotations: {
audience: ['user'],
priority: 0.5,
lastModified: mockDate
}
},
async () => ({
contents: [
@ -2346,6 +2352,11 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
expect(result.resources).toHaveLength(1);
expect(result.resources[0].description).toBe('Test resource');
expect(result.resources[0].mimeType).toBe('text/plain');
expect(result.resources[0].annotations).toEqual({
audience: ['user'],
priority: 0.5,
lastModified: mockDate
});
});
/***