Skip to main content
Glama
saidsurucu

İhale MCP

by saidsurucu

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'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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]:
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the token output and its use in another tool, which adds some context, but fails to describe critical behaviors like authentication needs (only hints at optional cookies), rate limits, error handling, or what the search returns beyond the token. For a search tool with zero 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Search parent authorities') and includes essential workflow information (token usage). There is no wasted text, making it highly concise and well-structured.

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 has an output schema (which likely covers return values), 100% schema coverage for inputs, and no annotations, the description is reasonably complete for a search tool. It specifies the search target and token workflow, though it could better address behavioral aspects like authentication or errors.

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 both parameters. The description adds no additional meaning about the parameters beyond what's in the schema (e.g., it doesn't clarify search syntax or cookie format). Baseline 3 is appropriate when the schema does all the work.

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 for parent authorities via 'ustIdareAra' and mentions the token output, which distinguishes it from generic search tools. However, it doesn't explicitly differentiate from sibling tools like 'search_authorities' or 'search_direct_procurement_authorities' beyond the 'parent authorities' focus.

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 implies usage by mentioning passing the token to 'parent_authority_code', suggesting a workflow context. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'search_authorities' or 'search_direct_procurement_authorities', nor does it specify prerequisites or exclusions.

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