Skip to main content
Glama
saidsurucu

İhale MCP

by saidsurucu

get_direct_procurement_details

Retrieve detailed information about direct procurement processes in Turkish public tenders using specific identifiers and session tokens.

Instructions

Get Direct Procurement (Doğrudan Temin) details (dtDetayGetir) using tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cookiesNoCookie header (Çerez) for EKAP session (optional)
dogrudan_temin_idYesE10 token (dogrudanTeminId) from list (liste)
idare_idYesE11 token (idareId) from list (liste)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary MCP tool handler function for 'get_direct_procurement_details'. Registered via @mcp.tool decorator with input schema defined by Annotated type hints. Executes the tool logic by calling the EKAPClient helper method.
    @mcp.tool
    async def get_direct_procurement_details(
        dogrudan_temin_id: Annotated[str, "E10 token (dogrudanTeminId) from list (liste)"],
        idare_id: Annotated[str, "E11 token (idareId) from list (liste)"],
        cookies: Annotated[Optional[str], "Cookie header (Çerez) for EKAP session (optional)"] = None,
    ) -> Dict[str, Any]:
        """
        Get Direct Procurement (Doğrudan Temin) details (dtDetayGetir) using tokens.
        """
        return await ekap_client.get_direct_procurement_details(
            dogrudan_temin_id=dogrudan_temin_id,
            idare_id=idare_id,
            cookies=cookies,
        )
  • Core helper method in EKAPClient class that implements the HTTP request to EKAP legacy endpoint, parses the JSON response, extracts and formats direct procurement details including basic info, authority, announcements, and contracts.
    async def get_direct_procurement_details(
        self,
        dogrudan_temin_id: str,
        idare_id: str,
        cookies: Optional[Any] = None,
    ) -> Dict[str, Any]:
        """Get details for a specific Direct Procurement (Doğrudan Temin).
    
        Calls YeniIhaleAramaData.ashx with metot=dtDetayGetir using the encrypted
        tokens returned by the list endpoint (E10=dogrudanTeminId, E11=idareId).
        """
        params = {
            "metot": "dtDetayGetir",
            "dogrudanTeminId": dogrudan_temin_id,
            "idareId": idare_id,
        }
        try:
            data = await self._make_get_request_full_url(self.direct_procurement_url, params=params, cookies=cookies)
            detail = data.get("dogrudanTeminDetayResult", {})
            if not detail:
                return {"error": "No details found", "success": False}
    
            dt_info = detail.get("DogrudanTeminBilgileri", {})
            authority_info = detail.get("IdareBilgileri", {})
            ilan_bilgileri = detail.get("IlanBilgileri", {})
            contract_info = detail.get("SozlesmeBilgileri", {})
    
            # Flatten announcement lists into a single list with categories
            announcements: List[Dict[str, Any]] = []
            def append_anns(items: Optional[List[Dict[str, Any]]], category: str):
                if not items:
                    return
                for it in items:
                    announcements.append({
                        "category": category,
                        "date": it.get("IlanTarihi"),
                        "type_code": it.get("IlanTipi"),
                        "enc_id": it.get("EncIlanId")
                    })
    
            append_anns(ilan_bilgileri.get("DogrudanTeminIlanBilgisiList"), "ilan")
            append_anns(ilan_bilgileri.get("DuzeltmeIlanBilgisiList"), "duzeltme")
            append_anns(ilan_bilgileri.get("IptalIlanBilgisiList"), "iptal")
            append_anns(ilan_bilgileri.get("SonucIlanBilgisiList"), "sonuc")
    
            result = {
                "basic": {
                    "dt_no": dt_info.get("Dtn"),
                    "name": dt_info.get("IsinAdi"),
                    "type": dt_info.get("Turu"),
                    "scope_article": dt_info.get("YasaKapsamiTeminMaddesi"),
                    "kismi_teklif": dt_info.get("KismiTeklif"),
                    "parts_count": dt_info.get("KisimSayisi"),
                    "okas_codes": dt_info.get("BransKodList", []),
                    "announcement_form": dt_info.get("IlaninSekli"),
                    "dt_datetime": dt_info.get("DtTarihSaati"),
                    "status": dt_info.get("DtDurumu"),
                    "cancel_reason": dt_info.get("IptalNedeni"),
                    "cancel_date": dt_info.get("IptalTarihi"),
                    "will_announce": dt_info.get("DogrudanTeminDuyurusuYapilacakMi"),
                    "is_electronic": dt_info.get("EIhale"),
                    "has_contract_draft": dt_info.get("DogrudanTeminSozlesmeTasarisiVarMi"),
                    "exception_basis": dt_info.get("IstisnaAliminDayanagi"),
                    "regulation_basis": dt_info.get("MevzuatDayanagi"),
                },
                "authority": {
                    "top_authority": authority_info.get("EnUstIdare"),
                    "parent_authority": authority_info.get("UstIdare"),
                    "name": authority_info.get("Idare"),
                    "province": authority_info.get("Ili"),
                },
                "announcements": announcements,
                "contracts": contract_info.get("SozlesmeBilgisiList", []),
                "tokens": {
                    "dogrudanTeminId": dogrudan_temin_id,
                    "idareId": idare_id
                },
                "success": True
            }
            return result
        except httpx.HTTPStatusError as e:
            return {
                "error": f"Direct procurement detail failed with status {e.response.status_code}",
                "message": str(e),
                "success": False
            }
        except Exception as e:
            return {
                "error": "Direct procurement detail request failed",
                "message": str(e),
                "success": False
            }
  • ihale_mcp.py:408-408 (registration)
    The @mcp.tool decorator registers the get_direct_procurement_details function as an MCP tool.
    @mcp.tool
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It mentions 'using tokens' but doesn't disclose authentication needs, rate limits, error handling, or what the output contains. For a tool with required parameters and no annotation coverage, this is inadequate.

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?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core purpose. However, it could be slightly more structured by separating usage context from the core action.

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

Completeness3/5

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

Given 100% schema coverage and an output schema exists, the description doesn't need to explain parameters or return values. However, for a tool with required parameters and no annotations, it should provide more context on authentication, errors, or usage scenarios to be complete.

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%, so the schema fully documents all parameters. The description adds no additional parameter semantics beyond implying tokens are needed, which is already covered in schema descriptions. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb ('Get') and resource ('Direct Procurement details'), and includes the Turkish function name 'dtDetayGetir' for specificity. However, it doesn't explicitly differentiate this tool from sibling tools like 'search_direct_procurements' or 'get_tender_details', which would require a 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions 'using tokens' but doesn't explain prerequisites or compare to sibling tools like 'search_direct_procurements' for listing or 'get_tender_details' for other procurement types.

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

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