search_cbbaskankarar
Search Turkish Presidential Decisions by keywords in titles and content. Filter by date range and exact phrase matching.
Instructions
Search for Turkish Presidential Decisions (Cumhurbaşkanı Kararı) in both titles and content.
IMPORTANT: Search is keyword-based, NOT by decision number. Use descriptive Turkish terms. Presidential Decisions are executive decisions (different from Presidential Decrees/Kararnamesi). Note: Bakanlar Kurulu Kararı (BKK) is NOT a separate type - older BKKs may appear here or in Kanun.
Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase"
Example queries:
"atama" - Find decisions about appointments
"ihracat AND rejim" - Export regime decisions
"vergi" or "gümrük" - Tax or customs decisions
Leave empty with dates to list all decisions from a period
Returns: Decision number, title, publication date, Official Gazette info. PDF format only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aranacak_ifade | No | Search query with optional Boolean operators: simple word (organize), AND (organize AND suç), OR (suç OR ceza), NOT (organize NOT terör), + for required (+term), grouping with (), exact phrase with quotes ("organize suç"). Leave empty to list all decrees. | |
| tam_cumle | No | Exact phrase match (true) or any word match (false, default). Set to true when searching for exact phrases. | |
| baslangic_tarihi | No | Start year for filtering results (format: YYYY, e.g., '2018') | |
| bitis_tarihi | No | End year for filtering results (format: YYYY, e.g., '2024') | |
| page_number | No | Page number for pagination (starts at 1) | |
| aranacak_yer | No | Where to search: 1=Title only, 2=Content only, 3=Both title and content (default) | |
| page_size | No | Number of results per page (1-100) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documents | Yes | ||
| total_results | Yes | ||
| current_page | Yes | ||
| page_size | Yes | ||
| total_pages | Yes | ||
| query_used | Yes | ||
| error_message | No |
Implementation Reference
- mevzuat_mcp_server.py:880-965 (handler)Tool handler for 'search_cbbaskankarar' - searches Turkish Presidential Decisions (Cumhurbaşkanı Kararı) by keyword with Boolean operators, date filters, and pagination. Registered via @app.tool() decorator on FastMCP instance. Creates a MevzuatSearchRequestNew with mevzuat_tur='Cumhurbaşkanı Kararı' and delegates to mevzuat_client.search_documents().
async def search_cbbaskankarar( aranacak_ifade: Optional[str] = Field( None, description='Search query with optional Boolean operators: simple word (organize), AND (organize AND suç), OR (suç OR ceza), NOT (organize NOT terör), + for required (+term), grouping with (), exact phrase with quotes ("organize suç"). Leave empty to list all decrees.' ), tam_cumle: bool = Field( False, description="Exact phrase match (true) or any word match (false, default). Set to true when searching for exact phrases." ), baslangic_tarihi: Optional[str] = Field( None, description="Start year for filtering results (format: YYYY, e.g., '2018')" ), bitis_tarihi: Optional[str] = Field( None, description="End year for filtering results (format: YYYY, e.g., '2024')" ), page_number: int = Field( 1, ge=1, description="Page number for pagination (starts at 1)" ), aranacak_yer: int = Field( 3, ge=1, le=3, description="Where to search: 1=Title only, 2=Content only, 3=Both title and content (default)" ), page_size: int = Field( 25, ge=1, le=100, description="Number of results per page (1-100)" ) ) -> MevzuatSearchResultNew: """ Search for Turkish Presidential Decisions (Cumhurbaşkanı Kararı) in both titles and content. IMPORTANT: Search is keyword-based, NOT by decision number. Use descriptive Turkish terms. Presidential Decisions are executive decisions (different from Presidential Decrees/Kararnamesi). Note: Bakanlar Kurulu Kararı (BKK) is NOT a separate type - older BKKs may appear here or in Kanun. Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase" Example queries: - "atama" - Find decisions about appointments - "ihracat AND rejim" - Export regime decisions - "vergi" or "gümrük" - Tax or customs decisions - Leave empty with dates to list all decisions from a period Returns: Decision number, title, publication date, Official Gazette info. PDF format only. """ search_req = MevzuatSearchRequestNew( mevzuat_tur="Cumhurbaşkanı Kararı", aranacak_ifade=aranacak_ifade or "", aranacak_yer=aranacak_yer, tam_cumle=tam_cumle, mevzuat_no=None, baslangic_tarihi=baslangic_tarihi, bitis_tarihi=bitis_tarihi, page_number=page_number, page_size=page_size ) log_params = search_req.model_dump(exclude_defaults=True) logger.info(f"Tool 'search_cbbaskankarar' called with parameters: {log_params}") try: result = await mevzuat_client.search_documents(search_req) if not result.documents and not result.error_message: result.error_message = "No Presidential Decisions found matching the specified criteria." return result except Exception as e: logger.exception("Error in tool 'search_cbbaskankarar'") return MevzuatSearchResultNew( documents=[], total_results=0, current_page=page_number, page_size=page_size, total_pages=0, query_used=log_params, error_message=f"An unexpected error occurred: {str(e)}" ) - mevzuat_mcp_server.py:879-880 (registration)Tool registration via FastMCP @app.tool() decorator. The 'app' is a FastMCP instance defined at line 38.
@app.tool() async def search_cbbaskankarar( - mevzuat_mcp_server.py:881-914 (schema)Input schema for 'search_cbbaskankarar' tool with 7 Pydantic Field parameters: query string (supports Boolean operators), exact phrase toggle, start/end date filters (YYYY), page number, search location (title/content/both), and page size.
aranacak_ifade: Optional[str] = Field( None, description='Search query with optional Boolean operators: simple word (organize), AND (organize AND suç), OR (suç OR ceza), NOT (organize NOT terör), + for required (+term), grouping with (), exact phrase with quotes ("organize suç"). Leave empty to list all decrees.' ), tam_cumle: bool = Field( False, description="Exact phrase match (true) or any word match (false, default). Set to true when searching for exact phrases." ), baslangic_tarihi: Optional[str] = Field( None, description="Start year for filtering results (format: YYYY, e.g., '2018')" ), bitis_tarihi: Optional[str] = Field( None, description="End year for filtering results (format: YYYY, e.g., '2024')" ), page_number: int = Field( 1, ge=1, description="Page number for pagination (starts at 1)" ), aranacak_yer: int = Field( 3, ge=1, le=3, description="Where to search: 1=Title only, 2=Content only, 3=Both title and content (default)" ), page_size: int = Field( 25, ge=1, le=100, description="Number of results per page (1-100)" ) ) -> MevzuatSearchResultNew: - mevzuat_mcp_server.py:914-965 (schema)Return type is MevzuatSearchResultNew (imported from mevzuat_models). On success returns search results with documents list; on failure returns a MevzuatSearchResultNew with error_message.
) -> MevzuatSearchResultNew: """ Search for Turkish Presidential Decisions (Cumhurbaşkanı Kararı) in both titles and content. IMPORTANT: Search is keyword-based, NOT by decision number. Use descriptive Turkish terms. Presidential Decisions are executive decisions (different from Presidential Decrees/Kararnamesi). Note: Bakanlar Kurulu Kararı (BKK) is NOT a separate type - older BKKs may appear here or in Kanun. Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase" Example queries: - "atama" - Find decisions about appointments - "ihracat AND rejim" - Export regime decisions - "vergi" or "gümrük" - Tax or customs decisions - Leave empty with dates to list all decisions from a period Returns: Decision number, title, publication date, Official Gazette info. PDF format only. """ search_req = MevzuatSearchRequestNew( mevzuat_tur="Cumhurbaşkanı Kararı", aranacak_ifade=aranacak_ifade or "", aranacak_yer=aranacak_yer, tam_cumle=tam_cumle, mevzuat_no=None, baslangic_tarihi=baslangic_tarihi, bitis_tarihi=bitis_tarihi, page_number=page_number, page_size=page_size ) log_params = search_req.model_dump(exclude_defaults=True) logger.info(f"Tool 'search_cbbaskankarar' called with parameters: {log_params}") try: result = await mevzuat_client.search_documents(search_req) if not result.documents and not result.error_message: result.error_message = "No Presidential Decisions found matching the specified criteria." return result except Exception as e: logger.exception("Error in tool 'search_cbbaskankarar'") return MevzuatSearchResultNew( documents=[], total_results=0, current_page=page_number, page_size=page_size, total_pages=0, query_used=log_params, error_message=f"An unexpected error occurred: {str(e)}" )