Skip to main content
Glama
saidsurucu

Mevzuat MCP

by saidsurucu

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

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)
aranacak_yerNoWhere to search: 1=Title only, 2=Content only, 3=Both title and content (default)
page_sizeNoNumber of results per page (1-100)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentsYes
total_resultsYes
current_pageYes
page_sizeYes
total_pagesYes
query_usedYes
error_messageNo

Implementation Reference

  • 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)}"
            )
  • The @app.tool() decorator registers 'search_cbk' as an MCP tool on the FastMCP server.
    @app.tool()
  • 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:
Behavior4/5

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

With no annotations, the description bears full responsibility for behavioral disclosure. It describes what is returned (decree number, title, publication date, Official Gazette info) and mentions pagination. It does not disclose potential rate limits, permissions, or side effects, but as a search tool, it is reasonably transparent. The description adds value beyond structured fields.

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 sections (explanation, important note, query syntax, example queries, returns). It is front-loaded with purpose. While it is longer than minimal, each section contributes useful information. A slightly more condensed version could achieve a 5, but it remains effective.

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 presence of an output schema (mentioned in context signals), the description does not need to detail return values. It covers all essential aspects: purpose, query syntax, scope (title/content/both), pagination, and date filtering. It is complete for a search tool with good parameter coverage and sibling differentiation.

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

Parameters4/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 providing query syntax examples and clarifying the keyword-based nature, which enhances understanding of the 'aranacak_ifade' parameter. It also explains the 'aranacak_yer' options more clearly. Thus, it goes beyond simple schema repetition.

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. It explains the resource and action, and the return fields specify what is output. Sibling tools like search_cbbaskankarar and search_within_cbk suggest different scopes, and the description implicitly differentiates by focusing on keyword search.

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

Usage Guidelines4/5

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

The description explicitly states the tool is keyword-based and NOT by decree number, which guides usage. It provides query syntax and example queries. However, it does not explicitly state when to use this tool over siblings (e.g., search_cbbaskankarar for other decree types) or give exclusion criteria, which would elevate to a 5.

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