Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 40 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ Then add this to your Client, eg Claude ...

## 💡 Available Tools

The server provides 11 tools for searching the Program Integrity Alliance (PIA) database:
The server provides 12 tools for searching the Program Integrity Alliance (PIA) database:

### Core Search Tools

### 1. `pia_search_content`

**Purpose:** Comprehensive search tool for querying document content and recommendations in the PIA database.

**Description:** Returns comprehensive results with full citation information and clickable links for proper attribution. Each result includes corresponding citations with data source attribution. Major data sources include: Department of Justice (198k+ docs), Congress.gov (29k+ docs), Oversight.gov (22k+ docs), CRS (22k+ docs), GAO (10k+ docs). Supports complex OData filtering with boolean logic, operators, and grouping.
**Description:** Returns comprehensive results with full citation information and clickable links for proper attribution. Each result includes corresponding citations with data source attribution. Major data sources include: Department of Justice (198k+ docs), Congress.gov (29k+ docs), Oversight.gov (22k+ docs), CRS (22k+ docs), GAO (10k+ docs), Federal Register (1k+ executive orders). Use pia_search_content_executive_orders to search only executive orders. Supports complex OData filtering with boolean logic, operators, and grouping.

**Parameters:**
- `query` (required): Search query text
Expand All @@ -173,7 +173,7 @@ The server provides 11 tools for searching the Program Integrity Alliance (PIA)

**Purpose:** Get available facets (filter values) for the PIA database content search.

**Description:** This can help understand what filter values are available before performing content searches. Major data sources include: Department of Justice (198k+ docs), Congress.gov (29k+ docs), Oversight.gov (22k+ docs), CRS (22k+ docs), GAO (10k+ docs).
**Description:** This can help understand what filter values are available before performing content searches. Major data sources include: Department of Justice (198k+ docs), Congress.gov (29k+ docs), Oversight.gov (22k+ docs), CRS (22k+ docs), GAO (10k+ docs), Federal Register (1k+ executive orders). Use pia_search_content_executive_orders to search only executive orders.

**Parameters:**
- `query` (optional): Optional query to get facets for (default: "")
Expand All @@ -183,7 +183,7 @@ The server provides 11 tools for searching the Program Integrity Alliance (PIA)

**Purpose:** Search the Program Integrity Alliance (PIA) database for document titles only.

**Description:** Returns document titles and metadata without searching the full content. Useful for finding specific documents by title or discovering available documents. Major data sources include: Department of Justice (198k+ docs), Congress.gov (29k+ docs), Oversight.gov (22k+ docs), CRS (22k+ docs), GAO (10k+ docs).
**Description:** Returns document titles and metadata without searching the full content. Useful for finding specific documents by title or discovering available documents. Major data sources include: Department of Justice (198k+ docs), Congress.gov (29k+ docs), Oversight.gov (22k+ docs), CRS (22k+ docs), GAO (10k+ docs), Federal Register (1k+ executive orders). Use pia_search_content_executive_orders to search only executive orders.

**Parameters:**
- `query` (required): Search query text (searches document titles only)
Expand All @@ -197,7 +197,7 @@ The server provides 11 tools for searching the Program Integrity Alliance (PIA)

**Purpose:** Get available facets (filter values) for the PIA database title search.

**Description:** This can help understand what filter values are available before performing title searches. Major data sources include: Department of Justice (198k+ docs), Congress.gov (29k+ docs), Oversight.gov (22k+ docs), CRS (22k+ docs), GAO (10k+ docs).
**Description:** This can help understand what filter values are available before performing title searches. Major data sources include: Department of Justice (198k+ docs), Congress.gov (29k+ docs), Oversight.gov (22k+ docs), CRS (22k+ docs), GAO (10k+ docs), Federal Register (1k+ executive orders). Use pia_search_content_executive_orders to search only executive orders.

**Parameters:**
- `query` (optional): Optional query to get facets for (default: "")
Expand Down Expand Up @@ -228,7 +228,7 @@ The server provides 11 tools for searching the Program Integrity Alliance (PIA)

**Parameters:**
- `query` (required): Search query text
- `filter` (optional): OData filter expression (SourceDocumentDataSource is automatically set to 'OIG')
- `filter` (optional): OData filter expression (SourceDocumentDataSource is automatically set to 'Oversight.gov')
- `page` (optional): Page number (default: 1)
- `page_size` (optional): Results per page (default: 10)
- `search_mode` (optional): Search mode (default: content)
Expand Down Expand Up @@ -280,9 +280,37 @@ The server provides 11 tools for searching the Program Integrity Alliance (PIA)
- `limit` (optional): Maximum results limit
- `include_facets` (optional): Include facets in results (default: false)

### Executive Orders Search Tool

### 10. `pia_search_content_executive_orders`

**Purpose:** Search for Executive Orders document content from the Federal Register.

**Description:** This tool automatically filters results to only include Executive Orders from the Federal Register (https://www.federalregister.gov/). Returns comprehensive results with full citation information and clickable links for proper attribution. Each result includes corresponding citations with data source attribution. Supports complex OData filtering with boolean logic, operators, and grouping.

**Parameters:**
- `query` (required): Search query text
- `filter` (optional): OData filter expression (SourceDocumentDataSource is automatically set to 'Federal Register' and SourceDocumentDataSet is set to 'executive orders')
- `page` (optional): Page number (default: 1)
- `page_size` (optional): Results per page (default: 10)
- `search_mode` (optional): Search mode (default: content)
- `limit` (optional): Maximum results limit
- `include_facets` (optional): Include facets in results (default: false)

**Executive Orders Coverage:**
- **Time Period:** Last 7 presidencies
- **Source:** Federal Register (https://www.federalregister.gov/presidential-documents/executive-orders)
- **Volume:** 1k+ executive orders
- **Update Frequency:** Weekly updates

**Example Searches:**
- Search for cybersecurity executive orders: `{"query": "cybersecurity"}`
- Search for recent executive orders: `{"query": "artificial intelligence", "filter": "SourceDocumentPublishDate ge '2023-01-01'"}`
- Search by specific topics: `{"query": "climate change OR environmental"}`

### ChatGPT Connector Tools

### 10. `search`
### 11. `search`

**Purpose:** Simple search interface for ChatGPT Connectors.

Expand All @@ -291,7 +319,7 @@ The server provides 11 tools for searching the Program Integrity Alliance (PIA)
**Parameters:**
- `query` (required): A search query string to find relevant documents in the PIA database

### 11. `fetch`
### 12. `fetch`

**Purpose:** Document retrieval by ID for ChatGPT Connectors.

Expand All @@ -309,12 +337,12 @@ Comprehensive search with OData filtering and faceting. The `filter` parameter u

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

**OData Filter Operators:**
- `eq` - equals: `field eq 'value'`
Expand Down Expand Up @@ -364,7 +392,7 @@ Use the `pia_search_facets` tool to explore what fields are available for filter
The facets response will show available fields and their possible values:
```json
{
"SourceDocumentDataSource": ["OIG", "GAO", "CMS", "FBI"],
"SourceDocumentDataSource": ["Oversight.gov", "GAO", "CMS", "FBI"],
"RecStatus": ["Open", "Closed", "In Progress"],
"RecPriorityFlag": ["High", "Medium", "Low", "Critical"],
"IsIntegrityRelated": ["Yes", "No"],
Expand All @@ -384,7 +412,7 @@ Filter: "SourceDocumentDataSource eq 'GAO' and SourceDocumentPublishDate ge '202
**Complex Example:**
```
Query: "healthcare violations"
Filter: "(SourceDocumentDataSource eq 'OIG' or SourceDocumentDataSource eq 'CMS') and RecPriorityFlag in ('High', 'Critical') and SourceDocumentPublishDate ge '2023-01-01'"
Filter: "(SourceDocumentDataSource eq 'Oversight.gov' or SourceDocumentDataSource eq 'CMS') and RecPriorityFlag in ('High', 'Critical') and SourceDocumentPublishDate ge '2023-01-01'"
```

## 📝 AI Instruction Prompts
Expand Down
2 changes: 1 addition & 1 deletion src/pia_mcp_server/prompts/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def _generate_titles_search_guidance() -> str:
- Construct the filter in **OData syntax**:
- `SourceDocumentDataSource eq 'GAO'`
- `SourceDocumentTitle contains 'fraud'`
- `(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'OIG') and SourceDocumentIsRecDoc eq 'Yes'`
- `(SourceDocumentDataSource eq 'GAO' or SourceDocumentDataSource eq 'Oversight.gov') and SourceDocumentIsRecDoc eq 'Yes'`
- Use correct operators: `eq`, `ne`, `gt`, `ge`, `lt`, `le`, `and`, `or`, `contains`
- Wrap string values in single quotes `'value'`
Expand Down
5 changes: 5 additions & 0 deletions src/pia_mcp_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
handle_pia_search_content_crs,
handle_pia_search_content_doj,
handle_pia_search_content_congress,
handle_pia_search_content_executive_orders,
handle_search,
handle_fetch,
)
Expand All @@ -36,6 +37,7 @@
pia_search_content_crs_tool,
pia_search_content_doj_tool,
pia_search_content_congress_tool,
pia_search_content_executive_orders_tool,
search_tool,
fetch_tool,
)
Expand Down Expand Up @@ -75,6 +77,7 @@ async def list_tools() -> List[types.Tool]:
pia_search_content_crs_tool,
pia_search_content_doj_tool,
pia_search_content_congress_tool,
pia_search_content_executive_orders_tool,
search_tool,
fetch_tool,
]
Expand Down Expand Up @@ -103,6 +106,8 @@ async def call_tool(name: str, arguments: Dict[str, Any]) -> List[types.TextCont
return await handle_pia_search_content_doj(arguments)
elif name == "pia_search_content_congress":
return await handle_pia_search_content_congress(arguments)
elif name == "pia_search_content_executive_orders":
return await handle_pia_search_content_executive_orders(arguments)
elif name == "search":
return await handle_search(arguments)
elif name == "fetch":
Expand Down
4 changes: 4 additions & 0 deletions src/pia_mcp_server/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
pia_search_content_doj_tool,
handle_pia_search_content_congress,
pia_search_content_congress_tool,
handle_pia_search_content_executive_orders,
pia_search_content_executive_orders_tool,
handle_search,
search_tool,
handle_fetch,
Expand All @@ -49,6 +51,8 @@
"pia_search_content_doj_tool",
"handle_pia_search_content_congress",
"pia_search_content_congress_tool",
"handle_pia_search_content_executive_orders",
"pia_search_content_executive_orders_tool",
"handle_search",
"search_tool",
"handle_fetch",
Expand Down
Loading