8000 Expose safety annotations for public MCP tools by hmmhmmhm · Pull Request #402 · hmmhmmhm/daiso-mcp · GitHub
[go: up one dir, main page]

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
5 changes: 5 additions & 0 deletions src/core/compact/server.ts
8000
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export function applyCompactTools(server: McpServer, registry: ServiceRegistry):
name: tool.name,
title: tool.metadata.title,
description: tool.metadata.description,
annotations: {
readOnlyHint: tool.name !== 'submit_request',
destructiveHint: false,
openWorldHint: true,
},
inputSchema: z.toJSONSchema(z.object(tool.metadata.inputSchema).strict(), {
io: 'input',
target: 'draft-7',
Expand Down
7 changes: 7 additions & 0 deletions tests/core/compact/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ describe('실제 MCP 프로토콜 10개 목록과 deprecated 호환', () => {
expect(list.tools.map((t) => t.name)).toEqual([...PUBLIC_TOOL_NAMES]);
expect(list.nextCursor).toBeUndefined();
expect(list.tools.every((t) => t.inputSchema.type === 'object')).toBe(true);
for (const tool of list.tools) {
expect(tool.annotations).toMatchObject({
readOnlyHint: tool.name !== 'submit_request',
destructiveHint: false,
openWorldHint: true,
});
}
const modern = await client.callTool({
name: 'search_products',
arguments: { service: 'daiso', query: '테ープ' },
Expand Down
Loading
0