search_kurum_yonetmelik
Search Turkish institutional regulations by title to find government organization rules, procedures, and administrative guidelines using Boolean operators and date filters.
Instructions
Search for Institutional and Organizational Regulations (Kurum ve Kuruluş Yönetmeliği) by title.
These are regulations issued by governmental institutions and organizations to regulate their internal operations, procedures, and administrative matters.
Note: This is the largest dataset with 8686+ regulations across all government institutions.
Query Syntax:
Simple keyword: nükleer
Exact phrase: "ihracat kontrol" (use quotes or set tam_cumle=True)
AND operator: nükleer AND ihracat (both terms must be present)
OR operator: denetim OR teftiş (at least one term must be present)
NOT operator: mali NOT ceza (first term present, second must not be)
Wildcard: kontrol* (matches kontrol, kontrolü, kontrole, etc.)
Combinations: (nükleer OR kimyasal) AND ihracat NOT silah
Returns:
List of matching regulations with numbers, titles, dates, and metadata
Pagination info and total result count
Each regulation includes: mevzuat_no, mev_adi, resmi_gazete_tarihi, etc.
Example usage:
search_kurum_yonetmelik(aranacak_ifade="nükleer") → Find nuclear-related regulations
search_kurum_yonetmelik(baslangic_tarihi="2025") → List all regulations from 2025
search_kurum_yonetmelik(aranacak_ifade="adalet AND akademi") → Find justice academy regulations
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aranacak_ifade | No | Search query with Boolean operators and wildcards. Examples: "nükleer" (simple), "ihracat AND kontrol" (AND), "denetim OR teftiş" (OR), "mali NOT ceza" (NOT), "kontrol*" (wildcard), "ithalat ihracat" (exact phrase with quotes). Leave empty to list all regulations in date range. | |
| tam_cumle | No | If True, searches for exact phrase match. If False (default), searches for any word match with Boolean operators. | |
| baslangic_tarihi | No | Start year for filtering results (format: YYYY, e.g., '2020'). Use with bitis_tarihi to define a date range. | |
| bitis_tarihi | No | End year for filtering results (format: YYYY, e.g., '2025'). Use with baslangic_tarihi to define a date range. | |
| page_number | No | Page number of results to retrieve (starts from 1) | |
| page_size | No | Number of results per page (1-100, default: 25) |
Implementation Reference
- mevzuat_mcp_server.py:1382-1469 (handler)The primary handler implementation for the 'search_kurum_yonetmelik' MCP tool. Defines the input schema via Pydantic Fields, registers the tool with @app.tool(), and implements the logic by creating a MevzuatSearchRequestNew for 'Kurum Yönetmeliği' type and calling mevzuat_client.search_documents() to fetch search results from mevzuat.gov.tr API.@app.tool() async def search_kurum_yonetmelik( aranacak_ifade: Optional[str] = Field( None, description='Search query with Boolean operators and wildcards. Examples: "nükleer" (simple), "ihracat AND kontrol" (AND), "denetim OR teftiş" (OR), "mali NOT ceza" (NOT), "kontrol*" (wildcard), "ithalat ihracat" (exact phrase with quotes). Leave empty to list all regulations in date range.' ), tam_cumle: bool = Field( False, description="If True, searches for exact phrase match. If False (default), searches for any word match with Boolean operators." ), baslangic_tarihi: Optional[str] = Field( None, description="Start year for filtering results (format: YYYY, e.g., '2020'). Use with bitis_tarihi to define a date range." ), bitis_tarihi: Optional[str] = Field( None, description="End year for filtering results (format: YYYY, e.g., '2025'). Use with baslangic_tarihi to define a date range." ), page_number: int = Field( 1, ge=1, description="Page number of results to retrieve (starts from 1)" ), page_size: int = Field( 25, ge=1, le=100, description="Number of results per page (1-100, default: 25)" ) ) -> MevzuatSearchResultNew: """ Search for Institutional and Organizational Regulations (Kurum ve Kuruluş Yönetmeliği) by title. These are regulations issued by governmental institutions and organizations to regulate their internal operations, procedures, and administrative matters. Note: This is the largest dataset with 8686+ regulations across all government institutions. Query Syntax: - Simple keyword: nükleer - Exact phrase: "ihracat kontrol" (use quotes or set tam_cumle=True) - AND operator: nükleer AND ihracat (both terms must be present) - OR operator: denetim OR teftiş (at least one term must be present) - NOT operator: mali NOT ceza (first term present, second must not be) - Wildcard: kontrol* (matches kontrol, kontrolü, kontrole, etc.) - Combinations: (nükleer OR kimyasal) AND ihracat NOT silah Returns: - List of matching regulations with numbers, titles, dates, and metadata - Pagination info and total result count - Each regulation includes: mevzuat_no, mev_adi, resmi_gazete_tarihi, etc. Example usage: - search_kurum_yonetmelik(aranacak_ifade="nükleer") → Find nuclear-related regulations - search_kurum_yonetmelik(baslangic_tarihi="2025") → List all regulations from 2025 - search_kurum_yonetmelik(aranacak_ifade="adalet AND akademi") → Find justice academy regulations """ logger.info(f"Tool 'search_kurum_yonetmelik' called: '{aranacak_ifade}', dates: {baslangic_tarihi}-{bitis_tarihi}") try: search_req = MevzuatSearchRequestNew( mevzuat_tur="Kurum Yönetmeliği", aranacak_ifade=aranacak_ifade or "", aranacak_yer=1, # Title search tam_cumle=tam_cumle, mevzuat_no=None, baslangic_tarihi=baslangic_tarihi, bitis_tarihi=bitis_tarihi, page_number=page_number, page_size=page_size ) result = await mevzuat_client.search_documents(search_req) logger.info(f"Found {result.total_results} institutional regulations") return result except Exception as e: logger.exception("Error in tool 'search_kurum_yonetmelik'") return MevzuatSearchResultNew( documents=[], total_results=0, current_page=page_number, page_size=page_size, total_pages=0, query_used={"error": str(e)}, error_message=f"An unexpected error occurred: {str(e)}" )
- mevzuat_mcp_server.py:1382-1382 (registration)The @app.tool() decorator registers the search_kurum_yonetmelik function as an MCP tool in the FastMCP server.@app.tool()
- mevzuat_mcp_server.py:1384-1411 (schema)Input schema defined by Pydantic Field descriptions for the tool parameters: query, exact match flag, date filters, pagination.aranacak_ifade: Optional[str] = Field( None, description='Search query with Boolean operators and wildcards. Examples: "nükleer" (simple), "ihracat AND kontrol" (AND), "denetim OR teftiş" (OR), "mali NOT ceza" (NOT), "kontrol*" (wildcard), "ithalat ihracat" (exact phrase with quotes). Leave empty to list all regulations in date range.' ), tam_cumle: bool = Field( False, description="If True, searches for exact phrase match. If False (default), searches for any word match with Boolean operators." ), baslangic_tarihi: Optional[str] = Field( None, description="Start year for filtering results (format: YYYY, e.g., '2020'). Use with bitis_tarihi to define a date range." ), bitis_tarihi: Optional[str] = Field( None, description="End year for filtering results (format: YYYY, e.g., '2025'). Use with baslangic_tarihi to define a date range." ), page_number: int = Field( 1, ge=1, description="Page number of results to retrieve (starts from 1)" ), page_size: int = Field( 25, ge=1, le=100, description="Number of results per page (1-100, default: 25)" ) ) -> MevzuatSearchResultNew:
- mevzuat_models.py:13-17 (schema)Output schema: MevzuatSearchResultNew Pydantic model returned by the tool, defining the structure of search results including documents list, pagination info, and error handling."KHK", "Tuzuk", "Kurum Yönetmeliği", "Cumhurbaşkanlığı Kararnamesi", "Cumhurbaşkanı Kararı",
- mevzuat_mcp_server.py:36-36 (helper)Initialization of MevzuatApiClientNew instance used by the tool for API calls to mevzuat.gov.tr.mevzuat_client = MevzuatApiClientNew(cache_ttl=3600, enable_cache=True)