Skip to main content
Glama
saidsurucu

Yargı MCP

by saidsurucu

search_anayasa_unified

Read-onlyIdempotent

Search Turkish Constitutional Court decisions for norm control (legislation review) or individual applications (rights violations) using keywords, dates, and filters.

Instructions

Use this when searching Turkish Constitutional Court decisions. Supports both norm control (legislation review) and individual applications (rights violations).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
decision_typeYesDecision type: norm_denetimi (norm control) or bireysel_basvuru (individual applications)
keywordsNoKeywords to search for (common parameter)
page_to_fetchNoPage number to fetch (1-100)
keywords_allNoAll keywords must be present (norm_denetimi only)
keywords_anyNoAny of these keywords (norm_denetimi only)
decision_type_normNoDecision type for norm denetimiALL
application_date_startNoApplication start date (norm_denetimi only)
application_date_endNoApplication end date (norm_denetimi only)
decision_start_dateNoDecision start date (bireysel_basvuru only)
decision_end_dateNoDecision end date (bireysel_basvuru only)
norm_typeNoNorm type (bireysel_basvuru only)ALL
subject_categoryNoSubject category (bireysel_basvuru only)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core tool handler: Unified search function that routes to norm denetimi or bireysel basvuru clients based on decision_type parameter. Implements the main search logic for the tool.
    async def search_unified(self, params: AnayasaUnifiedSearchRequest) -> AnayasaUnifiedSearchResult:
        """Unified search that routes to appropriate client based on decision_type."""
        
        if params.decision_type == "norm_denetimi":
            # Convert to norm denetimi request
            norm_params = AnayasaNormDenetimiSearchRequest(
                keywords_all=params.keywords_all or params.keywords,
                keywords_any=params.keywords_any,
                application_type=params.decision_type_norm,
                page_to_fetch=params.page_to_fetch,
                results_per_page=params.results_per_page
            )
            
            result = await self.norm_client.search_norm_denetimi_decisions(norm_params)
            
            # Convert to unified format
            decisions_list = [decision.model_dump() for decision in result.decisions]
            
            return AnayasaUnifiedSearchResult(
                decision_type="norm_denetimi",
                decisions=decisions_list,
                total_records_found=result.total_records_found,
                retrieved_page_number=result.retrieved_page_number
            )
            
        elif params.decision_type == "bireysel_basvuru":
            # Convert to bireysel başvuru request
            bireysel_params = AnayasaBireyselReportSearchRequest(
                keywords=params.keywords,
                decision_start_date=params.decision_start_date,
                decision_end_date=params.decision_end_date,
                norm_type=params.norm_type,
                subject_category=params.subject_category,
                page_to_fetch=params.page_to_fetch,
                results_per_page=params.results_per_page
            )
            
            result = await self.bireysel_client.search_bireysel_basvuru_report(bireysel_params)
            
            # Convert to unified format
            decisions_list = [decision.model_dump() for decision in result.decisions]
            
            return AnayasaUnifiedSearchResult(
                decision_type="bireysel_basvuru",
                decisions=decisions_list,
                total_records_found=result.total_records_found,
                retrieved_page_number=result.retrieved_page_number
            )
        
        else:
            raise ValueError(f"Unsupported decision type: {params.decision_type}")
  • Input schema for the unified Anayasa search tool, defining parameters like decision_type, keywords, pagination, etc.
    class AnayasaUnifiedSearchRequest(BaseModel):
        """Unified search request for both Norm Denetimi and Bireysel Başvuru."""
        decision_type: Literal["norm_denetimi", "bireysel_basvuru"] = Field(..., description="Decision type: norm_denetimi or bireysel_basvuru")
        
        # Common parameters
        keywords: List[str] = Field(default_factory=list, description="Keywords to search for")
        page_to_fetch: int = Field(1, ge=1, le=100, description="Page number to fetch (1-100)")
        results_per_page: int = Field(10, ge=1, le=100, description="Results per page (1-100)")
        
        # Norm Denetimi specific parameters (ignored for bireysel_basvuru)
        keywords_all: List[str] = Field(default_factory=list, description="All keywords must be present (norm_denetimi only)")
        keywords_any: List[str] = Field(default_factory=list, description="Any of these keywords (norm_denetimi only)")
        decision_type_norm: Literal["ALL", "1", "2", "3"] = Field("ALL", description="Decision type for norm denetimi")
        application_date_start: str = Field("", description="Application start date (norm_denetimi only)")
        application_date_end: str = Field("", description="Application end date (norm_denetimi only)")
        
        # Bireysel Başvuru specific parameters (ignored for norm_denetimi)
        decision_start_date: str = Field("", description="Decision start date (bireysel_basvuru only)")
        decision_end_date: str = Field("", description="Decision end date (bireysel_basvuru only)")
        norm_type: Literal["ALL", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "0"] = Field("ALL", description="Norm type (bireysel_basvuru only)")
        subject_category: str = Field("", description="Subject category (bireysel_basvuru only)")
  • Output schema for the unified Anayasa search tool, containing decision_type, decisions list, total_records_found, etc.
    class AnayasaUnifiedSearchResult(BaseModel):
        """Unified search result containing decisions from either system."""
        decision_type: Literal["norm_denetimi", "bireysel_basvuru"] = Field(..., description="Type of decisions returned")
        decisions: List[Dict[str, Any]] = Field(default_factory=list, description="Decision list (structure varies by type)")
        total_records_found: int = Field(0, description="Total number of records found")
        retrieved_page_number: int = Field(1, description="Page number that was retrieved")
  • Helper class providing the unified client instance used by the tool handler, initializes norm and bireysel clients.
    class AnayasaUnifiedClient:
        """Unified client that handles both Norm Denetimi and Bireysel Başvuru searches."""
        
        def __init__(self, request_timeout: float = 60.0):
            self.norm_client = AnayasaMahkemesiApiClient(request_timeout)
            self.bireysel_client = AnayasaBireyselBasvuruApiClient(request_timeout)
        
        async def search_unified(self, params: AnayasaUnifiedSearchRequest) -> AnayasaUnifiedSearchResult:
            """Unified search that routes to appropriate client based on decision_type."""
            
            if params.decision_type == "norm_denetimi":
                # Convert to norm denetimi request
                norm_params = AnayasaNormDenetimiSearchRequest(
                    keywords_all=params.keywords_all or params.keywords,
                    keywords_any=params.keywords_any,
                    application_type=params.decision_type_norm,
                    page_to_fetch=params.page_to_fetch,
                    results_per_page=params.results_per_page
                )
                
                result = await self.norm_client.search_norm_denetimi_decisions(norm_params)
                
                # Convert to unified format
                decisions_list = [decision.model_dump() for decision in result.decisions]
                
                return AnayasaUnifiedSearchResult(
                    decision_type="norm_denetimi",
                    decisions=decisions_list,
                    total_records_found=result.total_records_found,
                    retrieved_page_number=result.retrieved_page_number
                )
                
            elif params.decision_type == "bireysel_basvuru":
                # Convert to bireysel başvuru request
                bireysel_params = AnayasaBireyselReportSearchRequest(
                    keywords=params.keywords,
                    decision_start_date=params.decision_start_date,
                    decision_end_date=params.decision_end_date,
                    norm_type=params.norm_type,
                    subject_category=params.subject_category,
                    page_to_fetch=params.page_to_fetch,
                    results_per_page=params.results_per_page
                )
                
                result = await self.bireysel_client.search_bireysel_basvuru_report(bireysel_params)
                
                # Convert to unified format
                decisions_list = [decision.model_dump() for decision in result.decisions]
                
                return AnayasaUnifiedSearchResult(
                    decision_type="bireysel_basvuru",
                    decisions=decisions_list,
                    total_records_found=result.total_records_found,
                    retrieved_page_number=result.retrieved_page_number
                )
            
            else:
                raise ValueError(f"Unsupported decision type: {params.decision_type}")
        
        async def get_document_unified(self, document_url: str, page_number: int = 1) -> AnayasaUnifiedDocumentMarkdown:
            """Unified document retrieval that auto-detects the appropriate client."""
            
            # Auto-detect decision type based on URL
            parsed_url = urlparse(document_url)
            
            if "normkararlarbilgibankasi" in parsed_url.netloc or "/ND/" in document_url:
                # Norm Denetimi document
                result = await self.norm_client.get_decision_document_as_markdown(document_url, page_number)
                
                return AnayasaUnifiedDocumentMarkdown(
                    decision_type="norm_denetimi",
                    source_url=result.source_url,
                    document_data=result.model_dump(),
                    markdown_chunk=result.markdown_chunk,
                    current_page=result.current_page,
                    total_pages=result.total_pages,
                    is_paginated=result.is_paginated
                )
                
            elif "kararlarbilgibankasi" in parsed_url.netloc or "/BB/" in document_url:
                # Bireysel Başvuru document
                result = await self.bireysel_client.get_decision_document_as_markdown(document_url, page_number)
                
                return AnayasaUnifiedDocumentMarkdown(
                    decision_type="bireysel_basvuru",
                    source_url=result.source_url,
                    document_data=result.model_dump(),
                    markdown_chunk=result.markdown_chunk,
                    current_page=result.current_page,
                    total_pages=result.total_pages,
                    is_paginated=result.is_paginated
                )
            
            else:
                raise ValueError(f"Cannot determine document type from URL: {document_url}")
        
        async def close_client_session(self):
            """Close both client sessions."""
            if hasattr(self.norm_client, 'close_client_session'):
                await self.norm_client.close_client_session()
            if hasattr(self.bireysel_client, 'close_client_session'):
                await self.bireysel_client.close_client_session()
  • Client initialization for underlying norm_denetimi and bireysel_basvuru API clients.
    def __init__(self, request_timeout: float = 60.0):
        self.norm_client = AnayasaMahkemesiApiClient(request_timeout)
        self.bireysel_client = AnayasaBireyselBasvuruApiClient(request_timeout)
    
    async def search_unified(self, params: AnayasaUnifiedSearchRequest) -> AnayasaUnifiedSearchResult:
        """Unified search that routes to appropriate client based on decision_type."""
        
        if params.decision_type == "norm_denetimi":
            # Convert to norm denetimi request
            norm_params = AnayasaNormDenetimiSearchRequest(
                keywords_all=params.keywords_all or params.keywords,
                keywords_any=params.keywords_any,
                application_type=params.decision_type_norm,
                page_to_fetch=params.page_to_fetch,
                results_per_page=params.results_per_page
            )
            
            result = await self.norm_client.search_norm_denetimi_decisions(norm_params)
            
            # Convert to unified format
            decisions_list = [decision.model_dump() for decision in result.decisions]
            
            return AnayasaUnifiedSearchResult(
                decision_type="norm_denetimi",
                decisions=decisions_list,
                total_records_found=result.total_records_found,
                retrieved_page_number=result.retrieved_page_number
            )
            
        elif params.decision_type == "bireysel_basvuru":
            # Convert to bireysel başvuru request
            bireysel_params = AnayasaBireyselReportSearchRequest(
                keywords=params.keywords,
                decision_start_date=params.decision_start_date,
                decision_end_date=params.decision_end_date,
                norm_type=params.norm_type,
                subject_category=params.subject_category,
                page_to_fetch=params.page_to_fetch,
                results_per_page=params.results_per_page
            )
            
            result = await self.bireysel_client.search_bireysel_basvuru_report(bireysel_params)
            
            # Convert to unified format
            decisions_list = [decision.model_dump() for decision in result.decisions]
            
            return AnayasaUnifiedSearchResult(
                decision_type="bireysel_basvuru",
                decisions=decisions_list,
                total_records_found=result.total_records_found,
                retrieved_page_number=result.retrieved_page_number
            )
        
        else:
            raise ValueError(f"Unsupported decision type: {params.decision_type}")
Behavior3/5

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

Annotations already provide readOnlyHint=true, openWorldHint=true, and idempotentHint=true, indicating this is a safe, non-destructive, and repeatable search operation. The description adds context by specifying the two decision types supported, which helps clarify the tool's scope beyond what annotations convey. However, it doesn't disclose additional behavioral traits like rate limits, authentication needs, or pagination details (though output schema may cover some of this).

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 extremely concise with just two sentences that directly state the tool's purpose and scope. Every word earns its place—there's no redundancy or fluff. It's front-loaded with the core use case, making it easy for an agent to quickly understand when to apply this tool.

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 the tool's complexity (12 parameters, some with enums) and the presence of annotations and an output schema, the description is reasonably complete. It specifies the decision types, which is crucial context for using the tool correctly. With annotations covering safety and an output schema likely detailing return values, the description doesn't need to explain behavioral or output aspects, though it could benefit from more usage guidance relative to siblings.

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%, meaning all parameters are documented in the schema itself. The description doesn't add any parameter-specific details beyond what's in the schema (e.g., it doesn't explain parameter interactions or provide examples). Given the high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate with extra semantic value but also doesn't detract from the schema's completeness.

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

Purpose4/5

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

The description clearly states the tool searches Turkish Constitutional Court decisions and specifies the two supported decision types (norm control and individual applications). It provides a specific verb ('search') and resource ('Turkish Constitutional Court decisions'), but doesn't explicitly distinguish this from sibling search tools like 'search_bddk_decisions' or 'search_sayistay_unified' that search different legal databases.

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 provides basic context with 'Use this when searching Turkish Constitutional Court decisions,' which implies when to use this tool. However, it doesn't offer explicit guidance on when to choose this over alternative search tools on the server (like search_bddk_decisions for different legal domains) or when not to use it. The guidance is present but limited to the tool's scope without comparative context.

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/yargi-mcp'

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