Skip to content

Commit 0f8919b

Browse files
committed
Fix SourceDocumentDataSource references: 'OIG' → 'Oversight.gov'
- Update OIG tool description to use correct data source name - Fix all example filter expressions in documentation - Update test mock data to use 'Oversight.gov' instead of 'OIG' - Update test assertions to expect correct data source name - Ensure consistency across codebase for OIG-related content All 23 unit tests continue to pass with the corrected references.
1 parent b00b920 commit 0f8919b

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ The server provides 12 tools for searching the Program Integrity Alliance (PIA)
228228

229229
**Parameters:**
230230
- `query` (required): Search query text
231-
- `filter` (optional): OData filter expression (SourceDocumentDataSource is automatically set to 'OIG')
231+
- `filter` (optional): OData filter expression (SourceDocumentDataSource is automatically set to 'Oversight.gov')
232232
- `page` (optional): Page number (default: 1)
233233
- `page_size` (optional): Results per page (default: 10)
234234
- `search_mode` (optional): Search mode (default: content)
@@ -324,12 +324,12 @@ Comprehensive search with OData filtering and faceting. The `filter` parameter u
324324

325325
**Example Filter Expressions:**
326326
- Basic filter: `"SourceDocumentDataSource eq 'GAO'"`
327-
- Multiple conditions: `"SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'OIG'"`
327+
- Multiple conditions: `"SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'Oversight.gov'"`
328328
- Complex grouping: `"SourceDocumentDataSource eq 'GAO' and RecStatus ne 'Closed'"`
329329
- Negation: `"SourceDocumentDataSource ne 'Department of Justice' and not (RecStatus eq 'Closed')"`
330330
- List membership: `"IsIntegrityRelated eq 'Yes' and RecPriorityFlag in ('High', 'Critical')"`
331331
- Date ranges: `"SourceDocumentPublishDate ge '2020-01-01' and SourceDocumentPublishDate le '2024-12-31'"`
332-
- Boolean grouping: `"(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'OIG') and RecStatus eq 'Open'"`
332+
- Boolean grouping: `"(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'Oversight.gov') and RecStatus eq 'Open'"`
333333

334334
**OData Filter Operators:**
335335
- `eq` - equals: `field eq 'value'`
@@ -379,7 +379,7 @@ Use the `pia_search_facets` tool to explore what fields are available for filter
379379
The facets response will show available fields and their possible values:
380380
```json
381381
{
382-
"SourceDocumentDataSource": ["OIG", "GAO", "CMS", "FBI"],
382+
"SourceDocumentDataSource": ["Oversight.gov", "GAO", "CMS", "FBI"],
383383
"RecStatus": ["Open", "Closed", "In Progress"],
384384
"RecPriorityFlag": ["High", "Medium", "Low", "Critical"],
385385
"IsIntegrityRelated": ["Yes", "No"],
@@ -399,7 +399,7 @@ Filter: "SourceDocumentDataSource eq 'GAO' and SourceDocumentPublishDate ge '202
399399
**Complex Example:**
400400
```
401401
Query: "healthcare violations"
402-
Filter: "(SourceDocumentDataSource eq 'OIG' or SourceDocumentDataSource eq 'CMS') and RecPriorityFlag in ('High', 'Critical') and SourceDocumentPublishDate ge '2023-01-01'"
402+
Filter: "(SourceDocumentDataSource eq 'Oversight.gov' or SourceDocumentDataSource eq 'CMS') and RecPriorityFlag in ('High', 'Critical') and SourceDocumentPublishDate ge '2023-01-01'"
403403
```
404404

405405
## 📝 AI Instruction Prompts

src/pia_mcp_server/prompts/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def _generate_titles_search_guidance() -> str:
246246
- Construct the filter in **OData syntax**:
247247
- `SourceDocumentDataSource eq 'GAO'`
248248
- `SourceDocumentTitle contains 'fraud'`
249-
- `(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'OIG') and SourceDocumentIsRecDoc eq 'Yes'`
249+
- `(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'Oversight.gov') and SourceDocumentIsRecDoc eq 'Yes'`
250250
- Use correct operators: `eq`, `ne`, `gt`, `ge`, `lt`, `le`, `and`, `or`, `contains`
251251
- Wrap string values in single quotes `'value'`
252252

src/pia_mcp_server/tools/search_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
"query": {"type": "string", "description": "Search query text"},
227227
"filter": {
228228
"type": "string",
229-
"description": "Optional OData filter expression supporting complex boolean logic.\n\nAVAILABLE FIELDS:\n• Note: SourceDocumentDataSource is automatically set to 'OIG' for this tool. Major sources (>1k documents): 'Department of Justice', 'Congress.gov', 'Oversight.gov', 'CRS', 'GAO', 'Federal Register'\n• SourceDocumentDataSet: Dataset or collection the document belongs to. Values: 'press-releases', 'reports', 'bills-and-laws', 'federal-reports', 'executive orders', 'state-and-local-reports', 'federal reports'\n• SourceDocumentOrg: Organization associated with the document. There are many values, use pia_search_content_facets tool to see available options\n• SourceDocumentTitle: Document title - use contains, eq for text matching\n• SourceDocumentPublishDate: Publication date - ISO 8601 format YYYY-MM-DD (e.g., '2023-01-01'). Use ge/le for ranges\n• RecStatus: Recommendation status\n• RecPriorityFlag: Priority flag for recommendations\n• IsIntegrityRelated: Whether the content is integrity-related\n• SourceDocumentIsRecDoc: Whether the document contains recommendations. Values: 'No', 'Yes'\n• RecFraudRiskManagementThemePIA: Fraud risk management theme classification\n• RecMatterForCongressPIA: Whether the matter is for Congressional attention\n• RecRecommendation: Recommendation text - use contains, eq for text matching\n• RecAgencyComments: Agency comments on recommendations - use contains, eq for text matching\n\nOPERATORS:\n• Text: contains, eq, ne, startswith, endswith\n• Exact: eq (equals), ne (not equals), in (in list)\n• Date: ge (greater/equal), le (less/equal), eq (equals)\n• Logic: and, or, not, parentheses for grouping\n\nEXAMPLES:\n\"RecStatus eq 'Open'\"\n\"RecStatus ne 'Closed' and RecPriorityFlag eq 'Yes'\"\n\"IsIntegrityRelated eq 'True' and RecPriorityFlag eq 'Yes'\"\n\"(RecStatus eq 'Open' and RecPriorityFlag eq 'Yes')\"\n\"SourceDocumentPublishDate ge '2020-01-01' and SourceDocumentPublishDate le '2024-12-31'\"\n\nTIP: Use pia_search_content_facets tool to get the most current available values.",
229+
"description": "Optional OData filter expression supporting complex boolean logic.\n\nAVAILABLE FIELDS:\n• Note: SourceDocumentDataSource is automatically set to 'Oversight.gov' for this tool. Major sources (>1k documents): 'Department of Justice', 'Congress.gov', 'Oversight.gov', 'CRS', 'GAO', 'Federal Register'\n• SourceDocumentDataSet: Dataset or collection the document belongs to. Values: 'press-releases', 'reports', 'bills-and-laws', 'federal-reports', 'executive orders', 'state-and-local-reports', 'federal reports'\n• SourceDocumentOrg: Organization associated with the document. There are many values, use pia_search_content_facets tool to see available options\n• SourceDocumentTitle: Document title - use contains, eq for text matching\n• SourceDocumentPublishDate: Publication date - ISO 8601 format YYYY-MM-DD (e.g., '2023-01-01'). Use ge/le for ranges\n• RecStatus: Recommendation status\n• RecPriorityFlag: Priority flag for recommendations\n• IsIntegrityRelated: Whether the content is integrity-related\n• SourceDocumentIsRecDoc: Whether the document contains recommendations. Values: 'No', 'Yes'\n• RecFraudRiskManagementThemePIA: Fraud risk management theme classification\n• RecMatterForCongressPIA: Whether the matter is for Congressional attention\n• RecRecommendation: Recommendation text - use contains, eq for text matching\n• RecAgencyComments: Agency comments on recommendations - use contains, eq for text matching\n\nOPERATORS:\n• Text: contains, eq, ne, startswith, endswith\n• Exact: eq (equals), ne (not equals), in (in list)\n• Date: ge (greater/equal), le (less/equal), eq (equals)\n• Logic: and, or, not, parentheses for grouping\n\nEXAMPLES:\n\"RecStatus eq 'Open'\"\n\"RecStatus ne 'Closed' and RecPriorityFlag eq 'Yes'\"\n\"IsIntegrityRelated eq 'True' and RecPriorityFlag eq 'Yes'\"\n\"(RecStatus eq 'Open' and RecPriorityFlag eq 'Yes')\"\n\"SourceDocumentPublishDate ge '2020-01-01' and SourceDocumentPublishDate le '2024-12-31'\"\n\nTIP: Use pia_search_content_facets tool to get the most current available values.",
230230
},
231231
"page": {
232232
"type": "integer",

tests/test_tools.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ async def test_pia_search_content_with_complex_odata_filter():
139139
mock_client.return_value.__aenter__.return_value = mock_client_instance
140140

141141
# Test complex boolean logic filter
142-
complex_filter = "(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'OIG') and RecPriorityFlag in ('High', 'Critical')"
142+
complex_filter = "(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'Oversight.gov') and RecPriorityFlag in ('High', 'Critical')"
143143
result = await handle_pia_search_content(
144144
{"query": "integrity violations", "filter": complex_filter}
145145
)
@@ -221,7 +221,7 @@ async def test_pia_search_content_facets_success():
221221
"id": 1,
222222
"result": {
223223
"facets": {
224-
"SourceDocumentDataSource": ["OIG", "GAO", "CMS"],
224+
"SourceDocumentDataSource": ["Oversight.gov", "GAO", "CMS"],
225225
"RecStatus": ["Open", "Closed", "In Progress"],
226226
"RecPriorityFlag": ["High", "Medium", "Low", "Critical"],
227227
"IsIntegrityRelated": ["Yes", "No"],
@@ -243,7 +243,7 @@ async def test_pia_search_content_facets_success():
243243

244244
assert len(result) == 1
245245
assert "SourceDocumentDataSource" in result[0].text
246-
assert "OIG" in result[0].text
246+
assert "Oversight.gov" in result[0].text
247247
assert "RecStatus" in result[0].text
248248

249249

@@ -441,7 +441,7 @@ async def test_pia_search_content_facets_empty_filter():
441441
"id": 1,
442442
"result": {
443443
"facets": {
444-
"SourceDocumentDataSource": ["OIG", "GAO", "CMS"],
444+
"SourceDocumentDataSource": ["Oversight.gov", "GAO", "CMS"],
445445
"RecStatus": ["Open", "Closed"],
446446
}
447447
},
@@ -505,7 +505,11 @@ async def test_pia_search_content_oig_success():
505505
"id": 1,
506506
"result": {
507507
"documents": [
508-
{"title": "OIG Investigation", "id": "oig-123", "data_source": "OIG"}
508+
{
509+
"title": "OIG Investigation",
510+
"id": "oig-123",
511+
"data_source": "Oversight.gov",
512+
}
509513
],
510514
"total": 1,
511515
},

0 commit comments

Comments
 (0)