search_cbk
Search Turkish Presidential Decrees (Cumhurbaşkanlığı Kararnamesi) by keyword using Boolean operators and filters. Find decrees by title or content with date range and pagination.
Instructions
Search for Turkish Presidential Decrees (Cumhurbaşkanlığı Kararnamesi) in both titles and content.
IMPORTANT: Search is keyword-based, NOT by decree number. Use descriptive Turkish terms. Presidential Decrees are executive orders issued by the President of Turkey (post-2017).
Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase"
Example queries:
"organize suç" - Find decrees about organized crime
"kamu OR devlet" - Decrees about public or state matters
"bakanlık AND teşkilat" - Ministry organization decrees
Returns: Decree number, title, publication date, Official Gazette info.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aranacak_ifade | Yes | 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ç") | |
| 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:558-642 (handler)The 'search_cbk' tool handler: searches for Turkish Presidential Decrees (Cumhurbaşkanlığı Kararnamesi) on mevzuat.gov.tr by keyword. It delegates to MevzuatApiClientNew.search_documents() with mevzuat_tur='Cumhurbaşkanlığı Kararnamesi'.
@app.tool() async def search_cbk( aranacak_ifade: str = Field( ..., 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ç")' ), 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 Decrees (Cumhurbaşkanlığı Kararnamesi) in both titles and content. IMPORTANT: Search is keyword-based, NOT by decree number. Use descriptive Turkish terms. Presidential Decrees are executive orders issued by the President of Turkey (post-2017). Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase" Example queries: - "organize suç" - Find decrees about organized crime - "kamu OR devlet" - Decrees about public or state matters - "bakanlık AND teşkilat" - Ministry organization decrees Returns: Decree number, title, publication date, Official Gazette info. """ search_req = MevzuatSearchRequestNew( mevzuat_tur="Cumhurbaşkanlığı Kararnamesi", aranacak_ifade=aranacak_ifade, 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_cbk' 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 Decrees found matching the specified criteria." return result except Exception as e: logger.exception("Error in tool 'search_cbk'") 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:558-558 (registration)The @app.tool() decorator registers 'search_cbk' as an MCP tool on the FastMCP server.
@app.tool() - mevzuat_mcp_server.py:560-593 (schema)Input schema/parameters for search_cbk: search query, exact phrase toggle, date range, page number, search area, and page size.
aranacak_ifade: str = Field( ..., 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ç")' ), 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: