Skip to main content
Glama

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
NameRequiredDescriptionDefault
cookiesNoCookie header (Çerez) for EKAP session (optional)
search_termNoParent authority search (Bağlı Olduğu Üst İdare), e.g., 'antalya'

Implementation Reference

  • 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, )
  • 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
  • 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]:

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

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