Skip to content

Commit e9d3c07

Browse files
authored
fix: %s/annotation/annotations/ for tool registration (#54)
* fix: %s/annotation/annotations/ for tool registration Signed-off-by: John McBride <[email protected]> --------- Signed-off-by: John McBride <[email protected]>
1 parent a48ede9 commit e9d3c07

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

examples/servers/apps-sdk/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ server.addTool({
5252
validator: new ZodValidator(
5353
z.object({})
5454
),
55-
annotation: {
55+
annotations: {
5656
readOnlyHint: true,
5757
},
5858
_meta: {

src/server/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export class MCPServer {
162162
handler,
163163
description = `Execute the ${name} tool`,
164164
outputSchema,
165-
annotation,
165+
annotations,
166166
_meta,
167167
} = config;
168168

@@ -171,7 +171,7 @@ export class MCPServer {
171171
description,
172172
inputSchema: validator.jsonSchema as Tool["inputSchema"],
173173
...(outputSchema && { outputSchema }),
174-
...(annotation && { annotations: annotation }),
174+
...(annotations && { annotations }),
175175
...(_meta && { _meta }),
176176
};
177177

src/server/tools.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ describe("MCPServer Tools", () => {
328328

329329
it("both methods work with tools that have annotations", () => {
330330
const toolName = "annotated-tool";
331-
const annotation = {
331+
const annotations = {
332332
title: "Annotated Tool",
333333
readOnlyHint: true,
334334
destructiveHint: false,
@@ -346,16 +346,16 @@ describe("MCPServer Tools", () => {
346346
content: [{ type: "text", text: "annotation test" }],
347347
isError: false,
348348
}),
349-
annotation,
349+
annotations,
350350
});
351351

352352
// Test getTool
353353
const singleTool = server.getTool(toolName);
354-
expect(singleTool?.annotations).toEqual(annotation);
354+
expect(singleTool?.annotations).toEqual(annotations);
355355

356356
// Test getTools
357357
const allTools = server.getTools();
358-
expect(allTools.get(toolName)?.annotations).toEqual(annotation);
358+
expect(allTools.get(toolName)?.annotations).toEqual(annotations);
359359
});
360360

361361
it("both methods work with tools that have _meta", () => {

src/tools/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ export interface ToolConfig<
1818
handler: (params: ParsedData<V>) => Promise<R> | R;
1919
description?: string;
2020
outputSchema?: Tool["outputSchema"];
21-
annotation?: Tool["annotations"];
21+
annotations?: Tool["annotations"];
2222
_meta?: Tool["_meta"];
2323
}

0 commit comments

Comments
 (0)