Skip to main content
Glama
saidsurucu

Mevzuat MCP

by saidsurucu

search_teblig

Search Turkish communiqués by keyword in titles and content on mevzuat.gov.tr. Supports Boolean operators and exact phrase matching for precise results.

Instructions

Search for Turkish communiqués (Tebliğ) in both titles and content on mevzuat.gov.tr.

IMPORTANT: Search is keyword-based, NOT by number. Use descriptive Turkish terms. Communiqués are regulatory documents issued by various government institutions.

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

Example queries:

  • "katma değer vergisi" - Find VAT-related communiqués

  • "muafiyet OR istisna" - Communiqués about exemptions

  • "gümrük" - Customs-related communiqués

  • "ithalat" or "ihracat" - Import/export communiqués

Returns: Communiqué number, title, publication date, Official Gazette info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aranacak_ifadeYesSearch query with optional Boolean operators: simple word (vergi), AND (vergi AND muafiyet), OR (muafiyet OR istisna), NOT (vergi NOT gelir), + for required (+term), grouping with (), exact phrase with quotes ("katma değer vergisi")
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., '2020')
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

  • Registration of the 'search_teblig' tool as a FastMCP tool using @app.tool() decorator
    @app.tool()
    async def search_teblig(
        aranacak_ifade: str = Field(
            ...,
            description='Search query with optional Boolean operators: simple word (vergi), AND (vergi AND muafiyet), OR (muafiyet OR istisna), NOT (vergi NOT gelir), + for required (+term), grouping with (), exact phrase with quotes ("katma değer vergisi")'
        ),
        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., '2020')"
        ),
        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:
  • Handler function 'search_teblig' - searches Turkish communiqués (Tebliğ) on mevzuat.gov.tr. Uses keyword-based search with Boolean operators (AND/OR/NOT), date filtering, and pagination. Creates a MevzuatSearchRequestNew with mevzuat_tur='Tebliğ' and delegates to mevzuat_client.search_documents().
    async def search_teblig(
        aranacak_ifade: str = Field(
            ...,
            description='Search query with optional Boolean operators: simple word (vergi), AND (vergi AND muafiyet), OR (muafiyet OR istisna), NOT (vergi NOT gelir), + for required (+term), grouping with (), exact phrase with quotes ("katma değer vergisi")'
        ),
        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., '2020')"
        ),
        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 communiqués (Tebliğ) in both titles and content on mevzuat.gov.tr.
    
        IMPORTANT: Search is keyword-based, NOT by number. Use descriptive Turkish terms.
        Communiqués are regulatory documents issued by various government institutions.
    
        Query Syntax: Simple keyword, AND, OR, NOT, +required, (grouping), "exact phrase"
    
        Example queries:
        - "katma değer vergisi" - Find VAT-related communiqués
        - "muafiyet OR istisna" - Communiqués about exemptions
        - "gümrük" - Customs-related communiqués
        - "ithalat" or "ihracat" - Import/export communiqués
    
        Returns: Communiqué number, title, publication date, Official Gazette info.
        """
        search_req = MevzuatSearchRequestNew(
            mevzuat_tur="Tebliğ",
            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_teblig' 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 communiqués found matching the specified criteria."
    
            return result
    
        except Exception as e:
            logger.exception("Error in tool 'search_teblig'")
            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)}"
            )
  • Input schema - MevzuatSearchRequestNew model defines the search parameters used by search_teblig
    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"
        )
    
    
    class MevzuatDocumentNew(BaseModel):
        """Model for a single legislation document from mevzuat.gov.tr"""
    
        mevzuat_no: str = Field(..., description="Legislation number")
        mev_adi: str = Field(..., description="Legislation title/name")
        kabul_tarih: Optional[str] = Field(None, description="Acceptance date")
        resmi_gazete_tarihi: Optional[str] = Field(None, description="Official Gazette publication date")
        resmi_gazete_sayisi: Optional[str] = Field(None, description="Official Gazette issue number")
        mevzuat_tertip: str = Field(..., description="Legislation series/order")
        mevzuat_tur: int = Field(..., description="Legislation type code")
        url: str = Field(..., description="Relative URL to view the legislation")
    
        def get_pdf_url(self) -> str:
            """Generate PDF download URL for this legislation (only works for Kanun)."""
            return f"https://www.mevzuat.gov.tr/MevzuatMetin/{self.mevzuat_tur}.{self.mevzuat_tertip}.{self.mevzuat_no}.pdf"
    
        def get_web_url(self) -> str:
            """Generate web page URL for this legislation."""
            return f"https://www.mevzuat.gov.tr/{self.url}"
    
    
    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
    
    
    class MevzuatArticleContent(BaseModel):
        """Model for the content of legislation (reused from old models)."""
        madde_id: str
        mevzuat_id: str
        markdown_content: str
        error_message: Optional[str] = None
  • Output schema - MevzuatSearchResultNew model defines the return type of search_teblig
    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
  • MevzuatApiClientNew.search_documents() - the underlying API client method called by search_teblig to actually perform the HTTP request to mevzuat.gov.tr
            )
    
    async def search_documents(self, request: MevzuatSearchRequestNew) -> MevzuatSearchResultNew:
Behavior3/5

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

With no annotations, description carries full burden. It explains search behavior (keyword-based, exact phrase option) and return fields, but omits details on pagination limits, result ordering, or whether the operation is read-only.

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?

Description is well-structured: purpose, important note, syntax, examples, returns. Examples are helpful but add length; still concise and front-loaded with critical information.

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

Completeness4/5

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

Given output schema exists, description appropriately states return fields. All parameters are documented. Missing details on potential errors or data volume, but sufficient for a search tool with clear purpose and good annotation coverage.

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 descriptions already cover all 7 parameters (100% coverage). Description adds value by explaining the query syntax and providing examples, which go beyond the schema's parameter 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?

Description clearly states the tool searches for Turkish communiqués (Tebliğ) in titles and content on mevzuat.gov.tr, with specific verb 'search' and resource 'Tebliğ'. It distinguishes from sibling tools like search_kanun or search_khk by targeting a specific document type.

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?

Explicitly notes that search is keyword-based, not by number, guiding users to use descriptive Turkish terms. Provides query syntax and examples, but does not explicitly mention alternative tools like get_teblig_content for number-based lookups.

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