Coverage for src/qdrant_loader_mcp_server/mcp/schemas/expand_cluster.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-09-08 06:06 +0000

1from typing import Any 

2 

3 

4def get_expand_cluster_tool_schema() -> dict[str, Any]: 

5 return { 

6 "name": "expand_cluster", 

7 "description": "Retrieve all documents from a specific cluster for lazy loading", 

8 "annotations": {"read-only": True}, 

9 "inputSchema": { 

10 "type": "object", 

11 "properties": { 

12 "cluster_id": { 

13 "type": "string", 

14 "description": "The ID of the cluster to expand and retrieve all documents", 

15 }, 

16 "limit": { 

17 "type": "integer", 

18 "description": "Maximum number of documents to return from cluster (default: 20)", 

19 "default": 20, 

20 "minimum": 1, 

21 }, 

22 "offset": { 

23 "type": "integer", 

24 "description": "Number of documents to skip for pagination (default: 0)", 

25 "default": 0, 

26 "minimum": 0, 

27 }, 

28 "include_metadata": { 

29 "type": "boolean", 

30 "description": "Include detailed metadata for each document (default: true)", 

31 "default": True, 

32 }, 

33 }, 

34 "required": ["cluster_id"], 

35 "additionalProperties": False, 

36 }, 

37 "outputSchema": { 

38 "type": "object", 

39 "additionalProperties": False, 

40 "properties": { 

41 "cluster_id": { 

42 "type": "string", 

43 "description": "The expanded cluster ID", 

44 }, 

45 "cluster_info": { 

46 "type": "object", 

47 "description": "Detailed cluster information", 

48 "additionalProperties": False, 

49 "properties": { 

50 "cluster_name": {"type": "string"}, 

51 "cluster_theme": {"type": "string"}, 

52 "document_count": {"type": "integer"}, 

53 }, 

54 }, 

55 "documents": { 

56 "type": "array", 

57 "description": "Full list of documents in the cluster", 

58 "items": { 

59 "type": "object", 

60 "additionalProperties": False, 

61 "properties": { 

62 "id": {"type": "string"}, 

63 "text": {"type": "string"}, 

64 "metadata": { 

65 "type": "object", 

66 "additionalProperties": True, 

67 }, 

68 }, 

69 "required": ["id", "text"], 

70 }, 

71 }, 

72 "pagination": { 

73 "type": "object", 

74 "description": "Pagination information", 

75 "additionalProperties": False, 

76 "properties": { 

77 "page": {"type": "integer"}, 

78 "page_size": {"type": "integer"}, 

79 "total": {"type": "integer"}, 

80 "has_more": {"type": "boolean"}, 

81 }, 

82 "required": ["page", "page_size", "total", "has_more"], 

83 }, 

84 }, 

85 "required": ["cluster_id", "documents", "pagination"], 

86 }, 

87 }