Skip to main content
Glama

list_oke_work_requests

Monitor and track asynchronous operations for Oracle Container Engine (OKE) resources by listing work requests in a specified compartment, including operation types, status, and associated resources.

Instructions

List work requests (async operations) for OKE resources in a compartment.

Args:
    compartment_id: OCID of the compartment
    resource_id: Optional OCID of a specific resource (cluster or node pool) to filter by

Returns:
    List of work requests with their details including:
    - Operation type (create, update, delete, etc.)
    - Status and completion percentage
    - Associated resources
    - Timestamps (accepted, started, finished)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compartment_idYes
resource_idNo

Implementation Reference

  • Core handler function that executes the tool logic: lists OKE work requests using OCI ContainerEngineClient.list_work_requests, formats the response into a list of dictionaries with details like id, operation_type, status, resources, percent_complete, and timestamps.
    def list_work_requests(container_engine_client: oci.container_engine.ContainerEngineClient,
                           compartment_id: str,
                           resource_id: Optional[str] = None) -> List[Dict[str, Any]]:
        """
        List work requests in a compartment, optionally filtered by resource.
    
        Args:
            container_engine_client: OCI ContainerEngine client
            compartment_id: OCID of the compartment
            resource_id: Optional OCID of the resource to filter by (cluster or node pool)
    
        Returns:
            List of work requests with their details
        """
        try:
            kwargs = {"compartment_id": compartment_id}
            if resource_id:
                kwargs["resource_id"] = resource_id
    
            work_requests_response = oci.pagination.list_call_get_all_results(
                container_engine_client.list_work_requests,
                **kwargs
            )
    
            work_requests = []
            for wr in work_requests_response.data:
                work_requests.append({
                    "id": wr.id,
                    "operation_type": wr.operation_type,
                    "status": wr.status,
                    "compartment_id": wr.compartment_id,
                    "resources": [
                        {
                            "action_type": res.action_type if hasattr(res, 'action_type') else None,
                            "entity_type": res.entity_type if hasattr(res, 'entity_type') else None,
                            "identifier": res.identifier if hasattr(res, 'identifier') else None,
                            "entity_uri": res.entity_uri if hasattr(res, 'entity_uri') else None,
                        }
                        for res in wr.resources
                    ] if hasattr(wr, 'resources') and wr.resources else [],
                    "percent_complete": wr.percent_complete if hasattr(wr, 'percent_complete') else None,
                    "time_accepted": str(wr.time_accepted) if hasattr(wr, 'time_accepted') and wr.time_accepted else None,
                    "time_started": str(wr.time_started) if hasattr(wr, 'time_started') and wr.time_started else None,
                    "time_finished": str(wr.time_finished) if hasattr(wr, 'time_finished') and wr.time_finished else None,
                })
    
            logger.info(f"Found {len(work_requests)} work requests in compartment {compartment_id}" +
                       (f" for resource {resource_id}" if resource_id else ""))
            return work_requests
  • MCP tool registration for 'list_oke_work_requests' with wrapper for error handling, logging, and profile management. Calls the handler from tools.oke.list_work_requests.
    @mcp.tool(name="list_oke_work_requests")
    @mcp_tool_wrapper(
        start_msg="Listing OKE work requests in compartment {compartment_id}...",
        error_prefix="Error listing OKE work requests"
    )
    async def mcp_list_oke_work_requests(
        ctx: Context,
        compartment_id: str,
        resource_id: Optional[str] = None
    ) -> List[Dict[str, Any]]:
        """
        List work requests (async operations) for OKE resources in a compartment.
    
        Args:
            compartment_id: OCID of the compartment
            resource_id: Optional OCID of a specific resource (cluster or node pool) to filter by
    
        Returns:
            List of work requests with their details including:
            - Operation type (create, update, delete, etc.)
            - Status and completion percentage
            - Associated resources
            - Timestamps (accepted, started, finished)
        """
        return list_work_requests(oci_clients["container_engine"], compartment_id, resource_id)
Behavior3/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 describes the return format (list of work requests with details like operation type, status, resources, timestamps), which is helpful. However, it doesn't mention critical behavioral aspects such as pagination, rate limits, authentication requirements, or whether this is a read-only operation (though 'List' implies it). The description adds some value but lacks comprehensive behavioral context.

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 well-structured and front-loaded with the core purpose in the first sentence. The 'Args' and 'Returns' sections are clearly labeled and provide essential information without redundancy. Every sentence earns its place, making it efficient and easy to parse, with no wasted words.

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 the complexity (a list operation with 2 parameters), no annotations, and no output schema, the description is moderately complete. It covers the purpose, parameters, and return format adequately. However, it lacks details on behavioral aspects like pagination or error handling, and without annotations or output schema, it doesn't fully compensate for these gaps, making it sufficient but not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It provides clear semantics for both parameters: 'compartment_id' as 'OCID of the compartment' and 'resource_id' as 'Optional OCID of a specific resource (cluster or node pool) to filter by'. This adds meaningful context beyond the bare schema, explaining what the parameters represent and their optional nature. However, it doesn't detail format constraints or examples, keeping it from a perfect score.

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 'List' and the resource 'work requests (async operations) for OKE resources in a compartment'. It specifies the domain (OKE resources) and scope (compartment-based), which is clear and specific. However, it doesn't explicitly differentiate from sibling tools like 'get_oke_work_request' (singular) or other list tools, so it doesn't reach the highest score.

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 context by mentioning 'in a compartment' and optional filtering by resource_id, but it doesn't provide explicit guidance on when to use this tool versus alternatives. For example, it doesn't compare to 'get_oke_work_request' (singular) or other list tools, nor does it mention prerequisites or exclusions. This leaves usage somewhat inferred rather than clearly stated.

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/jopsis/mcp-server-oci'

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