Skip to main content
Glama
saidsurucu

Mevzuat MCP

by saidsurucu

search_kurum_yonetmelik

Search institutional regulations (Kurum Yönetmeliği) by keyword, Boolean operators, and date range. Returns regulation number, title, dates, and Official Gazette info for regulations like Gümrük Yönetmeliği.

Instructions

Search for Institutional/Organizational Regulations (Kurum ve Kuruluş Yönetmeliği) in titles and content.

IMPORTANT: Search is keyword-based, NOT by regulation number. Use descriptive Turkish terms. These are regulations issued by governmental institutions (ministries, agencies, boards). This is the largest dataset with 8686+ regulations. Use for: Gümrük Yönetmeliği, İthalat/İhracat Yönetmeliği, and similar institutional regulations.

Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase"

Example queries:

  • "gümrük" - Customs regulations (e.g., Gümrük Yönetmeliği)

  • "ithalat" or "ihracat" - Import/export regulations

  • "nükleer" - Nuclear regulations

  • "adalet AND akademi" - Justice academy regulations

  • Leave empty with dates to list all regulations from a period

Returns: Regulation number, title, dates, Official Gazette info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aranacak_ifadeNoSearch 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_cumleNoIf True, searches for exact phrase match. If False (default), searches for any word match with Boolean operators.
baslangic_tarihiNoStart year for filtering results (format: YYYY, e.g., '2020'). Use with bitis_tarihi to define a date range.
bitis_tarihiNoEnd year for filtering results (format: YYYY, e.g., '2025'). Use with baslangic_tarihi to define a date range.
page_numberNoPage number of results to retrieve (starts from 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, default: 25)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentsYes
total_resultsYes
current_pageYes
page_sizeYes
total_pagesYes
query_usedYes
error_messageNo

Implementation Reference

  • Handler function for the 'search_kurum_yonetmelik' MCP tool. Accepts keyword search with Boolean operators, date filters, and pagination. Creates a MevzuatSearchRequestNew with mevzuat_tur='Kurum Yönetmeliği' (mapped to 'KurumVeKurulusYonetmeligi' by the API client), delegates to mevzuat_client.search_documents(), and returns the search results.
    @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)"
        ),
        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, default: 25)"
        )
    ) -> MevzuatSearchResultNew:
        """
        Search for Institutional/Organizational Regulations (Kurum ve Kuruluş Yönetmeliği) in titles and content.
    
        IMPORTANT: Search is keyword-based, NOT by regulation number. Use descriptive Turkish terms.
        These are regulations issued by governmental institutions (ministries, agencies, boards).
        This is the largest dataset with 8686+ regulations. Use for: Gümrük Yönetmeliği, İthalat/İhracat
        Yönetmeliği, and similar institutional regulations.
    
        Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase"
    
        Example queries:
        - "gümrük" - Customs regulations (e.g., Gümrük Yönetmeliği)
        - "ithalat" or "ihracat" - Import/export regulations
        - "nükleer" - Nuclear regulations
        - "adalet AND akademi" - Justice academy regulations
        - Leave empty with dates to list all regulations from a period
    
        Returns: Regulation number, title, dates, Official Gazette info.
        """
        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=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
            )
    
            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)}"
            )
  • Type definition for valid mevzuat types, including 'Kurum Yönetmeliği' used by the search_kurum_yonetmelik tool.
    MevzuatTurLiteral = Literal[
        "Kanun",
        "KHK",
        "Tuzuk",
        "Kurum Yönetmeliği",
        "Cumhurbaşkanlığı Kararnamesi",
        "Cumhurbaşkanı Kararı",
        "CB Yönetmeliği",
        "CB Genelgesi",
        "Tebliğ",
        "Diğer"
    ]
    
    # Search location options
    AranacakYerLiteral = Literal[
        "1",  # Başlık
        "2",  # Madde Başlığı
        "3",  # Tüm Metin
    ]
  • Registration of search_kurum_yonetmelik as an MCP tool via the @app.tool() decorator on the FastMCP 'app' instance.
    @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)"
        ),
        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, default: 25)"
        )
    ) -> MevzuatSearchResultNew:
        """
        Search for Institutional/Organizational Regulations (Kurum ve Kuruluş Yönetmeliği) in titles and content.
    
        IMPORTANT: Search is keyword-based, NOT by regulation number. Use descriptive Turkish terms.
        These are regulations issued by governmental institutions (ministries, agencies, boards).
        This is the largest dataset with 8686+ regulations. Use for: Gümrük Yönetmeliği, İthalat/İhracat
        Yönetmeliği, and similar institutional regulations.
    
        Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase"
    
        Example queries:
        - "gümrük" - Customs regulations (e.g., Gümrük Yönetmeliği)
        - "ithalat" or "ihracat" - Import/export regulations
        - "nükleer" - Nuclear regulations
        - "adalet AND akademi" - Justice academy regulations
        - Leave empty with dates to list all regulations from a period
    
        Returns: Regulation number, title, dates, Official Gazette info.
        """
        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=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
            )
    
            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)}"
            )
  • Maps the internal type name 'Kurum Yönetmeliği' to the API value 'KurumVeKurulusYonetmeligi' used by mevzuat.gov.tr search endpoint.
    MEVZUAT_TUR_API_MAPPING = {
        "Kurum Yönetmeliği": "KurumVeKurulusYonetmeligi",
        "Cumhurbaşkanlığı Kararnamesi": "CumhurbaskaniKararnameleri",
        "Cumhurbaşkanı Kararı": "CumhurbaskaniKararlari",
        "CB Yönetmeliği": "CumhurbaskanligiVeBakanlarKuruluYonetmelik",
        "CB Genelgesi": "CumhurbaskanligiGenelgeleri",
        "Tebliğ": "Teblig",
        # Other types remain as-is
    }
  • Defines article-based legislation types; type '7' corresponds to Kurum Yönetmeliği (used in search_within_kurum_yonetmelik).
    ARTICLE_BASED_TYPES = {1, 2, 4, 7, 19, 21}  # Kanun, Tuzuk, KHK, Kurum Yonetmeligi, CBK, CB Yonetmeligi
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that search is keyword-based, explains query syntax with Boolean operators and examples, and states return fields. It does not mention whether it is read-only or any rate limits, but the read-only nature is implied by the search operation. Overall, it provides sufficient behavioral context.

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

Conciseness5/5

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

The description is well-structured with a clear first sentence, an 'IMPORTANT' callout, query syntax, examples, and return values. Every sentence is informative and earns its place. It is concise yet comprehensive, with no redundant or vague statements.

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 (7 parameters, no required fields, no output schema details), the description covers all essential aspects: the type of regulations, how to query, date range, location, pagination, and what is returned. It provides enough context for an agent to use the tool effectively without additional documentation.

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 baseline is 3. The description adds significant value beyond schema by explaining query syntax with practical examples, clarifying the 'tam_cumle' parameter, and showing how to use date filters and search location. This extra guidance helps the agent form correct queries.

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?

Description clearly states it searches for institutional regulations ('Kurum ve Kuruluş Yönetmeliği') in titles and content. It specifies the dataset size (8686+ regulations) and gives concrete examples like Gümrük Yönetmeliği, İthalat/İhracat Yönetmeliği, distinguishing it from siblings that search other regulation types.

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

Usage Guidelines5/5

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

Explicitly says search is keyword-based, not by regulation number, and recommends descriptive Turkish terms. It provides a clear usage context: 'Use for: Gümrük Yönetmeliği, İthalat/İhracat Yönetmeliği, and similar institutional regulations.' The 'IMPORTANT' alert further guides correct usage.

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