search_direct_procurement_parent_authorities
Find parent procurement authorities in Turkish public tenders using search terms to identify relevant oversight organizations for tender submissions.
Instructions
Search parent authorities (Üst İdare) via ustIdareAra. Pass returned 'token' to parent_authority_code (ustIdareKod).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cookies | No | Cookie header (Çerez) for EKAP session (optional) | |
| search_term | No | Parent authority search (Bağlı Olduğu Üst İdare), e.g., 'antalya' |
Implementation Reference
- ihale_mcp.py:436-448 (handler)MCP tool handler function that defines the tool schema via Annotated parameters and delegates execution to the EKAPClient instance.@mcp.tool async def search_direct_procurement_parent_authorities( search_term: Annotated[str, "Parent authority search (Bağlı Olduğu Üst İdare), e.g., 'antalya'"] = "", cookies: Annotated[Optional[str], "Cookie header (Çerez) for EKAP session (optional)"] = None, ) -> Dict[str, Any]: """ Search parent authorities (Üst İdare) via ustIdareAra. Pass returned 'token' to parent_authority_code (ustIdareKod). """ return await ekap_client.search_direct_procurement_parent_authorities( search_term=search_term, cookies=cookies, )
- ihale_client.py:209-252 (helper)Core implementation in EKAPClient class: performs HTTP GET to EKAP legacy endpoint with metot='ustIdareAra', parses JSON response, extracts token/name pairs, handles errors.async def search_direct_procurement_parent_authorities( self, search_term: str, cookies: Optional[Any] = None, ) -> Dict[str, Any]: """Search parent authorities (üst idare) for Direct Procurement (ustIdareAra). Returns list of { token, name } where token is the code used as 'ustIdareKod' (e.g., '44|07'). """ params = { "metot": "ustIdareAra", "aranan": search_term or "", "ES": "", "ihaleidListesi": "", } try: data = await self._make_get_request_full_url( self.direct_procurement_url, params=params, cookies=cookies, ) items = data.get("ustIdareAramaResultList", []) results = [] for it in items: results.append({ "token": it.get("A"), "name": it.get("D"), }) return { "parent_authorities": results, "returned_count": len(results), "search_term": search_term, } except httpx.HTTPStatusError as e: return { "error": f"Parent authority search failed with status {e.response.status_code}", "message": str(e) } except Exception as e: return { "error": "Parent authority search failed", "message": str(e) }
- ihale_mcp.py:436-436 (registration)The @mcp.tool decorator registers this function as an MCP tool.@mcp.tool
- ihale_mcp.py:438-440 (schema)Input schema defined via type annotations with descriptions for MCP tool parameters.search_term: Annotated[str, "Parent authority search (Bağlı Olduğu Üst İdare), e.g., 'antalya'"] = "", cookies: Annotated[Optional[str], "Cookie header (Çerez) for EKAP session (optional)"] = None, ) -> Dict[str, Any]: