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

3 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-10 09:41 +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 "cluster_session_id": { 

17 "type": "string", 

18 "description": "UUID representing a clustering session", 

19 }, 

20 "limit": { 

21 "type": "integer", 

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

23 "default": 20, 

24 "minimum": 1, 

25 }, 

26 "offset": { 

27 "type": "integer", 

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

29 "default": 0, 

30 "minimum": 0, 

31 }, 

32 "include_metadata": { 

33 "type": "boolean", 

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

35 "default": True, 

36 }, 

37 }, 

38 "required": ["cluster_id", "cluster_session_id"], 

39 "additionalProperties": False, 

40 }, 

41 "outputSchema": { 

42 "type": "object", 

43 "additionalProperties": False, 

44 "properties": { 

45 "cluster_id": { 

46 "type": "string", 

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

48 }, 

49 "cluster_info": { 

50 "type": "object", 

51 "description": "Detailed cluster information", 

52 "additionalProperties": False, 

53 "properties": { 

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

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

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

57 }, 

58 }, 

59 "documents": { 

60 "type": "array", 

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

62 "items": { 

63 "type": "object", 

64 "additionalProperties": False, 

65 "properties": { 

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

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

68 "metadata": { 

69 "type": "object", 

70 "additionalProperties": True, 

71 }, 

72 }, 

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

74 }, 

75 }, 

76 "pagination": { 

77 "type": "object", 

78 "description": "Pagination information", 

79 "additionalProperties": False, 

80 "properties": { 

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

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

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

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

85 }, 

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

87 }, 

88 }, 

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

90 }, 

91 }