Skip to content

Commit 432f50f

Browse files
committed
add annotation metadata tests
1 parent f606274 commit 432f50f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/server/mcp.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,6 +2111,11 @@ describe("resource()", () => {
21112111
{
21122112
description: "Test resource",
21132113
mimeType: "text/plain",
2114+
annotations: {
2115+
audience: ["assistant"],
2116+
priority: 0.42,
2117+
lastModified: "2025-01-12T15:00:58Z"
2118+
}
21142119
},
21152120
async () => ({
21162121
contents: [
@@ -2140,6 +2145,11 @@ describe("resource()", () => {
21402145
expect(result.resources).toHaveLength(1);
21412146
expect(result.resources[0].description).toBe("Test resource");
21422147
expect(result.resources[0].mimeType).toBe("text/plain");
2148+
expect(result.resources[0].annotations).toEqual({
2149+
audience: ["assistant"],
2150+
priority: 0.42,
2151+
lastModified: "2025-01-12T15:00:58Z"
2152+
});
21432153
});
21442154

21452155
/***

src/spec.types.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,13 @@ function checkBlobResourceContents(
439439
sdk = spec;
440440
spec = sdk;
441441
}
442+
function checkResourceAnnotations(
443+
sdk: RemovePassthrough<SDKTypes.ResourceAnnotations>,
444+
spec: SpecTypes.Annotations
445+
) {
446+
sdk = spec;
447+
spec = sdk;
448+
}
442449
function checkResource(
443450
sdk: RemovePassthrough<SDKTypes.Resource>,
444451
spec: SpecTypes.Resource

0 commit comments

Comments
 (0)