You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Align tool schemas with remote server implementation
- Update pia_search tool schema to match remote server exactly
- Add missing filter parameter to pia_search_facets tool
- Update filter descriptions with actual field names and comprehensive examples
- Align documentation examples to use actual field names:
- SourceDocumentDataSource instead of data_source
- SourceDocumentPublishDate instead of published_date
- RecStatus, RecPriorityFlag, IsIntegrityRelated field names
- Update prompt examples to match remote implementation
- Ensure parameter descriptions match remote server's function signatures
This ensures the local proxy server's tool schemas exactly match the
remote server implementation at https://mcp.programintegrity.org/
"SourceDocumentPublishDate": "2020-01-01 to 2024-12-31"
201
204
}
202
205
```
203
206
@@ -207,13 +210,13 @@ Use the `pia_search` tool with discovered fields to create precise OData filters
207
210
**Basic Example:**
208
211
```
209
212
Query: "Medicare fraud"
210
-
Filter: "data_source in ('OIG', 'CMS') and published_date ge '2023-01-01' and document_type eq 'audit_report'"
213
+
Filter: "SourceDocumentDataSource eq 'GAO' and SourceDocumentPublishDate ge '2023-01-01' and IsIntegrityRelated eq 'Yes'"
211
214
```
212
215
213
216
**Complex Example:**
214
217
```
215
218
Query: "healthcare violations"
216
-
Filter: "(data_source eq 'OIG' or data_source eq 'CMS') and (severity eq 'High' or amount gt 1000000) and published_date ge '2023-01-01'"
219
+
Filter: "(SourceDocumentDataSource eq 'OIG' or SourceDocumentDataSource eq 'CMS') and RecPriorityFlag in ('High', 'Critical') and SourceDocumentPublishDate ge '2023-01-01'"
Copy file name to clipboardExpand all lines: src/pia_mcp_server/tools/search_tools.py
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -13,34 +13,37 @@
13
13
# Tool definitions based on the API response
14
14
pia_search_tool=types.Tool(
15
15
name="pia_search",
16
-
description="Search the Program Integrity Alliance (PIA) database for documents and recommendations. Returns comprehensive results with full citation information and clickable links for proper attribution. Each result includes corresponding citations with data source attribution (GAO, OIG, etc.). Supports OData filter expressions using operators like eq, ne, gt, ge, lt, le, and, or, etc.",
16
+
description="Search the Program Integrity Alliance (PIA) database for documents and recommendations. Returns comprehensive results with full citation information and clickable links for proper attribution. Each result includes corresponding citations with data source attribution (GAO, OIG, etc.). Supports complex OData filtering with boolean logic, operators, and grouping.",
"description": "OData filter expression supporting complex boolean logic. Examples: \"SourceDocumentDataSource eq 'GAO'\", \"SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'OIG'\", \"SourceDocumentDataSource eq 'GAO' and RecStatus ne 'Closed'\", \"SourceDocumentDataSource ne 'Department of Justice' and not (RecStatus eq 'Closed')\", \"IsIntegrityRelated eq 'Yes' and RecPriorityFlag in ('High', 'Critical')\", \"SourceDocumentPublishDate ge '2020-01-01' and SourceDocumentPublishDate le '2024-12-31'\", \"(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'OIG') and RecStatus eq 'Open'\"",
24
24
},
25
25
"page": {
26
26
"type": "integer",
27
-
"description": "Page number (default: 1)",
27
+
"description": "Page number (1-based)",
28
28
"default": 1,
29
29
},
30
30
"page_size": {
31
31
"type": "integer",
32
-
"description": "Results per page (default: 10)",
32
+
"description": "Number of results per page (max 50)",
33
33
"default": 10,
34
34
},
35
35
"search_mode": {
36
36
"type": "string",
37
-
"description": "Search mode (default: content)",
37
+
"description": 'Search mode - "content" for full-text search or "titles" for title-only search',
"description": "Alternative name for page_size (for compatibility)",
43
+
},
41
44
"include_facets": {
42
45
"type": "boolean",
43
-
"description": "Include facets in results",
46
+
"description": "Whether to include facets in response (default False to reduce token usage)",
44
47
"default": False,
45
48
},
46
49
},
@@ -50,15 +53,19 @@
50
53
51
54
pia_search_facets_tool=types.Tool(
52
55
name="pia_search_facets",
53
-
description="Get available facets (filter values) for the PIA database. This can help understand what filter values are available before performing searches.",
56
+
description="Get available facets (filter values) for the PIA database. This can help understand what filter values are available before performing searches. Supports complex OData filtering with boolean logic, operators, and grouping.",
54
57
inputSchema={
55
58
"type": "object",
56
59
"properties": {
57
60
"query": {
58
61
"type": "string",
59
-
"description": "Optional query to get facets for",
62
+
"description": "Optional query to get facets for (if empty, gets all facets)",
60
63
"default": "",
61
-
}
64
+
},
65
+
"filter": {
66
+
"type": "string",
67
+
"description": "Optional OData filter expression. Examples: \"SourceDocumentDataSource eq 'GAO'\", \"SourceDocumentDataSource eq 'GAO' and RecStatus ne 'Closed'\", \"IsIntegrityRelated eq 'Yes' and RecPriorityFlag in ('High', 'Critical')\", \"SourceDocumentPublishDate ge '2020-01-01' and SourceDocumentPublishDate le '2024-12-31'\"",
0 commit comments