Skip to content

Commit 74bb3e7

Browse files
committed
Add support for MCP hint annotations
1 parent 6e31773 commit 74bb3e7

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/cli/cli.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ interface HtkOperation {
1818
description: string;
1919
category: string;
2020
inputSchema: any;
21+
annotations?: {
22+
readOnlyHint?: boolean;
23+
destructiveHint?: boolean;
24+
idempotentHint?: boolean;
25+
openWorldHint?: boolean;
26+
};
2127
}
2228

2329
// NOTE: This logic is duplicated in src/index.ts — keep in sync.
@@ -401,7 +407,8 @@ function operationsToMcpTools(operations: HtkOperation[]): any[] {
401407
inputSchema: {
402408
type: 'object',
403409
properties: op.inputSchema?.properties ?? {},
404-
}
410+
},
411+
...(op.annotations && { annotations: op.annotations })
405412
}));
406413
}
407414

src/ui-bridge.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ export interface HtkOperation {
1212
category: string;
1313
inputSchema: object;
1414
outputSchema: object;
15+
annotations?: {
16+
readOnlyHint?: boolean;
17+
destructiveHint?: boolean;
18+
idempotentHint?: boolean;
19+
openWorldHint?: boolean;
20+
};
1521
}
1622

1723
interface PendingRequest {

0 commit comments

Comments
 (0)