Coverage for src/qdrant_loader_mcp_server/mcp/schemas/hierarchy.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_hierarchy_search_tool_schema() -> dict[str, Any]: 

5 return { 

6 "name": "hierarchy_search", 

7 "description": "Search Confluence documents with hierarchy-aware filtering and organization", 

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

9 "inputSchema": { 

10 "type": "object", 

11 "additionalProperties": False, 

12 "properties": { 

13 "query": { 

14 "type": "string", 

15 "description": "The search query in natural language", 

16 }, 

17 "hierarchy_filter": { 

18 "type": "object", 

19 "properties": { 

20 "depth": { 

21 "type": "integer", 

22 "description": "Filter by specific hierarchy depth (0 = root pages)", 

23 }, 

24 "parent_title": { 

25 "type": "string", 

26 "description": "Filter by parent page title", 

27 }, 

28 "root_only": { 

29 "type": "boolean", 

30 "description": "Show only root pages (no parent)", 

31 }, 

32 "has_children": { 

33 "type": "boolean", 

34 "description": "Filter by whether pages have children", 

35 }, 

36 }, 

37 }, 

38 "organize_by_hierarchy": { 

39 "type": "boolean", 

40 "description": "Group results by hierarchy structure", 

41 "default": False, 

42 }, 

43 "limit": { 

44 "type": "integer", 

45 "description": "Maximum number of results to return", 

46 "default": 10, 

47 }, 

48 }, 

49 "required": ["query"], 

50 }, 

51 "outputSchema": { 

52 "type": "object", 

53 "properties": { 

54 "results": { 

55 "type": "array", 

56 "items": { 

57 "type": "object", 

58 "properties": { 

59 "score": {"type": "number"}, 

60 "title": {"type": "string"}, 

61 "content": {"type": "string"}, 

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

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

64 "metadata": { 

65 "type": "object", 

66 "properties": { 

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

68 "project_id": {"type": "string"}, 

69 "page_id": {"type": "string"}, 

70 "hierarchy_level": {"type": "integer"}, 

71 }, 

72 }, 

73 }, 

74 }, 

75 }, 

76 "total_found": {"type": "integer"}, 

77 "hierarchy_organization": { 

78 "type": "object", 

79 "properties": { 

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

81 "hierarchy_groups": { 

82 "type": "array", 

83 "items": {"type": "object"}, 

84 }, 

85 }, 

86 }, 

87 }, 

88 }, 

89 }