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

5 return { 

6 "name": "attachment_search", 

7 "description": "Search for file attachments and their parent documents across Confluence, Jira, and other sources", 

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 "attachment_filter": { 

18 "type": "object", 

19 "additionalProperties": False, 

20 "properties": { 

21 "attachments_only": { 

22 "type": "boolean", 

23 "description": "Show only file attachments", 

24 }, 

25 "parent_document_title": { 

26 "type": "string", 

27 "description": "Filter by parent document title", 

28 }, 

29 "file_type": { 

30 "type": "string", 

31 "description": "Filter by file type (e.g., 'pdf', 'xlsx', 'png')", 

32 }, 

33 "file_size_min": { 

34 "type": "integer", 

35 "description": "Minimum file size in bytes", 

36 "minimum": 0, 

37 }, 

38 "file_size_max": { 

39 "type": "integer", 

40 "description": "Maximum file size in bytes", 

41 "minimum": 0, 

42 }, 

43 "author": { 

44 "type": "string", 

45 "description": "Filter by attachment author", 

46 }, 

47 }, 

48 }, 

49 "include_parent_context": { 

50 "type": "boolean", 

51 "description": "Include parent document information in results", 

52 "default": True, 

53 }, 

54 "limit": { 

55 "type": "integer", 

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

57 "default": 10, 

58 }, 

59 }, 

60 "required": ["query"], 

61 }, 

62 "outputSchema": { 

63 "type": "object", 

64 "properties": { 

65 "results": { 

66 "type": "array", 

67 "items": { 

68 "type": "object", 

69 "properties": { 

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

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

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

73 "attachment_info": { 

74 "type": "object", 

75 "properties": { 

76 "filename": {"type": "string"}, 

77 "file_type": {"type": "string"}, 

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

79 "parent_document": {"type": "string"}, 

80 }, 

81 }, 

82 "metadata": { 

83 "type": "object", 

84 "properties": { 

85 "file_path": {"type": "string"}, 

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

87 "upload_date": {"type": "string"}, 

88 "author": {"type": "string"}, 

89 }, 

90 }, 

91 }, 

92 }, 

93 }, 

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

95 "attachment_summary": { 

96 "type": "object", 

97 "properties": { 

98 "total_attachments": {"type": "integer"}, 

99 "file_types": {"type": "array", "items": {"type": "string"}}, 

100 "attachments_only": {"type": "boolean"}, 

101 }, 

102 }, 

103 }, 

104 }, 

105 }