Coverage for src/qdrant_loader_mcp_server/mcp/schemas/analyze_relationships.py: 100%
3 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-08 06:06 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-08 06:06 +0000
1from typing import Any
4def get_analyze_relationships_tool_schema() -> dict[str, Any]:
5 return {
6 "name": "analyze_relationships",
7 "description": "Analyze relationships between documents",
8 "annotations": {"read-only": True},
9 "inputSchema": {
10 "type": "object",
11 "properties": {
12 "query": {
13 "type": "string",
14 "description": "Search query to get documents for analysis",
15 "minLength": 1,
16 },
17 "limit": {
18 "type": "integer",
19 "description": "Maximum number of documents to analyze",
20 "default": 20,
21 "minimum": 1,
22 "maximum": 1000,
23 },
24 "source_types": {
25 "type": "array",
26 "items": {"type": "string"},
27 "description": "Optional list of source types to filter by",
28 },
29 "project_ids": {
30 "type": "array",
31 "items": {"type": "string"},
32 "description": "Optional list of project IDs to filter by",
33 },
34 "use_llm": {
35 "type": "boolean",
36 "description": "Enable LLM validation for top pairs (budgeted)",
37 "default": False,
38 },
39 "max_llm_pairs": {
40 "type": "integer",
41 "description": "Maximum number of pairs to analyze with LLM",
42 "default": 5,
43 "minimum": 0,
44 "maximum": 100,
45 },
46 "overall_timeout_s": {
47 "type": "number",
48 "description": "Overall analysis budget in seconds",
49 "default": 60,
50 "minimum": 0,
51 "maximum": 3600,
52 },
53 "max_pairs_total": {
54 "type": "integer",
55 "description": "Maximum candidate pairs to analyze after tiering",
56 "default": 1000,
57 "minimum": 0,
58 "maximum": 100000,
59 },
60 "text_window_chars": {
61 "type": "integer",
62 "description": "Per-document text window size for lexical analysis",
63 "default": 1000,
64 "minimum": 0,
65 "maximum": 10000,
66 },
67 },
68 "required": ["query"],
69 "additionalProperties": False,
70 },
71 "outputSchema": {
72 "type": "object",
73 "properties": {
74 "relationships": {
75 "type": "array",
76 "items": {
77 "type": "object",
78 "properties": {
79 "document_1": {"type": "string"},
80 "document_2": {"type": "string"},
81 "relationship_type": {"type": "string"},
82 "score": {"type": "number", "minimum": 0, "maximum": 1},
83 "description": {"type": "string"},
84 },
85 "required": [
86 "document_1",
87 "document_2",
88 "relationship_type",
89 "score",
90 ],
91 "additionalProperties": False,
92 },
93 },
94 "total_analyzed": {"type": "integer"},
95 "summary": {"type": "string"},
96 },
97 "required": ["relationships", "total_analyzed"],
98 "additionalProperties": False,
99 },
100 }