Skip to main content
Glama
saidsurucu

Mevzuat MCP

by saidsurucu

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)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentsYes
page_sizeYes
query_usedYes
total_pagesYes
current_pageYes
error_messageNo
total_resultsYes

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()
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It effectively discloses key behavioral traits: it's a search operation (implied read-only), explains what fields are searched (titles and full text), details the return format (decree number, title, dates, URLs), and includes pagination parameters. However, it doesn't mention rate limits, authentication needs, or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, syntax, returns, examples) and efficiently conveys necessary information. However, the query syntax section is quite detailed and could potentially be more concise while maintaining clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, search functionality), the description provides comprehensive context: clear purpose, detailed query syntax, return format explanation, and practical examples. With an output schema present and 100% schema description coverage, the description appropriately focuses on usage guidance rather than repeating structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds value by explaining query syntax with examples and clarifying that 'tam_cumle=true' enables exact phrase matching, but doesn't provide additional semantic context beyond what's already well-documented in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for 'Turkish Presidential Decrees (Cumhurbaşkanlığı Kararnamesi) in both titles and content' and explains what these decrees are. It distinguishes from siblings by specifying the document type (Presidential Decrees) rather than other legal documents like laws, regulations, or circulars mentioned in sibling tool names.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through the query examples and context of searching decrees, but doesn't explicitly state when to use this tool versus alternatives like 'search_within_cbk' or other sibling search tools. No explicit guidance on prerequisites or exclusions is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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