Skip to main content
Glama

get_oke_work_request

Retrieve detailed status and progress information for Oracle Container Engine (OKE) work requests, including operation type, completion percentage, associated resources, and timing details.

Instructions

Get detailed information about a specific OKE work request.

Args:
    work_request_id: OCID of the work request

Returns:
    Detailed work request information including:
    - Operation type and status
    - Completion percentage
    - Associated resources and actions
    - Timing information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
work_request_idYes

Implementation Reference

  • Core handler function that fetches and formats OKE work request details using OCI ContainerEngineClient.get_work_request
    def get_work_request(container_engine_client: oci.container_engine.ContainerEngineClient,
                         work_request_id: str) -> Dict[str, Any]:
        """
        Get details of a specific work request.
    
        Args:
            container_engine_client: OCI ContainerEngine client
            work_request_id: OCID of the work request
    
        Returns:
            Details of the work request
        """
        try:
            wr = container_engine_client.get_work_request(work_request_id).data
    
            work_request_details = {
                "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"Retrieved details for work request {work_request_id}")
            return work_request_details
    
        except Exception as e:
            logger.exception(f"Error getting work request details: {e}")
            raise
  • MCP tool registration with @mcp.tool(name="get_oke_work_request"), wraps the get_work_request handler from tools.oke module and adds logging/error handling via mcp_tool_wrapper decorator
    @mcp.tool(name="get_oke_work_request")
    @mcp_tool_wrapper(
        start_msg="Getting details for work request {work_request_id}...",
        error_prefix="Error getting work request details"
    )
    async def mcp_get_oke_work_request(ctx: Context, work_request_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific OKE work request.
    
        Args:
            work_request_id: OCID of the work request
    
        Returns:
            Detailed work request information including:
            - Operation type and status
            - Completion percentage
            - Associated resources and actions
            - Timing information
        """
        return get_work_request(oci_clients["container_engine"], work_request_id)

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