Skip to main content
Glama

search_cbk

Search Turkish Presidential Decrees by title and content using Boolean operators and exact phrase matching. Retrieve decree numbers, publication dates, and official links for legal research.

Instructions

Search for Turkish Presidential Decrees (Cumhurbaşkanlığı Kararnamesi) in both titles and content.

This tool searches in Presidential Decree titles and full text content. Presidential Decrees are executive orders issued by the President of Turkey.

Query Syntax:

  • Simple keyword: organize

  • Boolean AND: organize AND suç (both terms)

  • Boolean OR: suç OR ceza (at least one term)

  • Boolean NOT: organize NOT terör (first yes, second no)

  • Required term: +organize +suç (similar to AND)

  • Grouping: (organize OR terör) AND suç

  • Exact phrase: "organize suç" (or use tam_cumle=true)

Returns:

  • Decree number, title, and publication date

  • Official Gazette publication date and issue number

  • URLs for viewing online

Example queries:

  • "organize suç" - Find decrees about organized crime

  • "kamu OR devlet" - Decrees about public or state matters

  • "ceza AND infaz" - Decrees about criminal enforcement

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aranacak_ifadeYesSearch 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_cumleNoExact phrase match (true) or any word match (false, default). Set to true when searching for exact phrases.
baslangic_tarihiNoStart year for filtering results (format: YYYY, e.g., '2018')
bitis_tarihiNoEnd year for filtering results (format: YYYY, e.g., '2024')
page_numberNoPage number for pagination (starts at 1)
page_sizeNoNumber of results per page (1-100)

Implementation Reference

  • Handler function for the 'search_cbk' tool. Searches Turkish Presidential Decrees (CBK) by constructing a search request and delegating to mevzuat_client.search_documents.
    @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)" ), 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. This tool searches in Presidential Decree titles and full text content. Presidential Decrees are executive orders issued by the President of Turkey. Query Syntax: - Simple keyword: organize - Boolean AND: organize AND suç (both terms) - Boolean OR: suç OR ceza (at least one term) - Boolean NOT: organize NOT terör (first yes, second no) - Required term: +organize +suç (similar to AND) - Grouping: (organize OR terör) AND suç - Exact phrase: "organize suç" (or use tam_cumle=true) Returns: - Decree number, title, and publication date - Official Gazette publication date and issue number - URLs for viewing online Example queries: - "organize suç" - Find decrees about organized crime - "kamu OR devlet" - Decrees about public or state matters - "ceza AND infaz" - Decrees about criminal enforcement """ search_req = MevzuatSearchRequestNew( mevzuat_tur="Cumhurbaşkanlığı Kararnamesi", aranacak_ifade=aranacak_ifade, aranacak_yer=1, # Search in titles and content 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)}" )
  • Pydantic model defining the output schema of the search_cbk tool.
    class MevzuatSearchResultNew(BaseModel): """Model for search results from mevzuat.gov.tr""" documents: List[MevzuatDocumentNew] total_results: int current_page: int page_size: int total_pages: int query_used: Dict[str, Any] error_message: Optional[str] = None
  • Pydantic model used internally for the input parameters of the search_cbk tool.
    class MevzuatSearchRequestNew(BaseModel): """Request model for searching legislation on mevzuat.gov.tr""" mevzuat_tur: MevzuatTurLiteral = Field( "Kanun", description="Type of legislation. Currently only 'Kanun' (laws) are fully supported for content extraction." ) aranacak_ifade: Optional[str] = Field( None, description="Search term or phrase to look for in legislation" ) aranacak_yer: int = Field( 3, ge=1, le=3, description="Where to search: 1=Title only, 2=Article titles, 3=Full text (default)" ) tam_cumle: bool = Field( False, description="Exact phrase match (true) or any word match (false, default)" ) mevzuat_no: Optional[str] = Field( None, description="Specific legislation number to search for" ) baslangic_tarihi: Optional[str] = Field( None, description="Start date for filtering (format: DD.MM.YYYY)" ) bitis_tarihi: Optional[str] = Field( None, description="End date for filtering (format: DD.MM.YYYY)" ) page_number: int = Field( 1, ge=1, description="Page number of results" ) page_size: int = Field( 10, ge=1, le=100, description="Number of results per page" )
  • FastMCP decorator that registers the search_cbk function as a tool.
    @app.tool()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/saidsurucu/mevzuat-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server