refactor: enhance MCP tool management with risk policies and confirmation handling

This commit is contained in:
mlogclub
2026-07-28 11:33:15 +08:00
parent ed109047d3
commit 07370fe9a2
17 changed files with 448 additions and 117 deletions
+2
View File
@@ -56,12 +56,14 @@ func (c *Client) ListTools(ctx context.Context, cfg ServerConfig) ([]ToolInfo, e
}
ret := make([]ToolInfo, 0, len(result.Tools))
for _, tool := range result.Tools {
readOnlyHint := tool.Annotations != nil && tool.Annotations.ReadOnlyHint
ret = append(ret, ToolInfo{
Name: tool.Name,
Title: tool.Title,
Description: tool.Description,
InputSchema: tool.InputSchema,
OutputSchema: tool.OutputSchema,
ReadOnlyHint: readOnlyHint,
})
}
return ret, nil