Skip to main content
Glama

get_image

Retrieve detailed information about Oracle Cloud Infrastructure compute images, including launch options and operating system specifications, by providing the image OCID.

Instructions

Get detailed information about a specific compute image.

Args:
    image_id: OCID of the image to retrieve

Returns:
    Detailed image information including launch options and OS details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_idYes

Implementation Reference

  • Core handler function that executes the OCI Compute API call to retrieve image details and formats the response dictionary.
    def get_image(compute_client: oci.core.ComputeClient, image_id: str) -> Dict[str, Any]:
        """
        Get details of a specific image.
        
        Args:
            compute_client: OCI Compute client
            image_id: OCID of the image
            
        Returns:
            Details of the image
        """
        try:
            image = compute_client.get_image(image_id).data
            
            image_details = {
                "id": image.id,
                "display_name": image.display_name,
                "compartment_id": image.compartment_id,
                "operating_system": image.operating_system,
                "operating_system_version": image.operating_system_version,
                "lifecycle_state": image.lifecycle_state,
                "time_created": str(image.time_created),
                "size_in_mbs": image.size_in_mbs,
                "base_image_id": image.base_image_id,
                "create_image_allowed": image.create_image_allowed,
                "listing_type": image.listing_type,
                "launch_mode": image.launch_mode,
                "launch_options": {
                    "boot_volume_type": image.launch_options.boot_volume_type if image.launch_options else None,
                    "firmware": image.launch_options.firmware if image.launch_options else None,
                    "network_type": image.launch_options.network_type if image.launch_options else None,
                    "remote_data_volume_type": image.launch_options.remote_data_volume_type if image.launch_options else None,
                    "is_pv_encryption_in_transit_enabled": image.launch_options.is_pv_encryption_in_transit_enabled if image.launch_options else None,
                    "is_consistent_volume_naming_enabled": image.launch_options.is_consistent_volume_naming_enabled if image.launch_options else None,
                } if image.launch_options else None,
            }
            
            logger.info(f"Retrieved details for image {image_id}")
            return image_details
            
        except Exception as e:
            logger.exception(f"Error getting image details: {e}")
            raise
  • MCP tool registration using @mcp.tool(name="get_image") and wrapper function that provides the MCP Context, injects the OCI compute client, and handles logging/errors.
    @mcp.tool(name="get_image")
    @mcp_tool_wrapper(
        start_msg="Getting image details for {image_id}...",
        success_msg="Retrieved image details successfully",
        error_prefix="Error getting image details"
    )
    async def mcp_get_image(ctx: Context, image_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific compute image.
    
        Args:
            image_id: OCID of the image to retrieve
    
        Returns:
            Detailed image information including launch options and OS details
        """
        return get_image(oci_clients["compute"], image_id)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool retrieves 'detailed information' and specifies the return content, but it doesn't cover critical aspects like authentication requirements, rate limits, error conditions, or whether it's a read-only operation. For a tool with zero annotation coverage, this is a significant gap.

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 concise, with a clear purpose statement followed by bullet points for arguments and returns. Every sentence adds value without redundancy, making it easy to scan and understand quickly.

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 tool's low complexity (one parameter, no output schema, no annotations), the description is moderately complete. It covers the basic purpose and parameter semantics but lacks behavioral details and usage guidelines. For a simple read operation, this is adequate but leaves room for improvement in guiding the agent.

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 description adds meaningful context for the single parameter 'image_id' by explaining it as the 'OCID of the image to retrieve,' which clarifies its purpose beyond the schema's basic 'Image Id' title. With 0% schema description coverage and only one parameter, this compensation is effective, though it doesn't detail format constraints (e.g., OCID structure).

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's purpose: 'Get detailed information about a specific compute image.' It specifies the verb ('Get') and resource ('compute image'), making the action clear. However, it doesn't explicitly differentiate from sibling tools like 'list_images' or other 'get_' tools, 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 doesn't mention sibling tools like 'list_images' for browsing images or other 'get_' tools for different resources, nor does it specify prerequisites or contexts for usage. This lack of comparative guidance limits its effectiveness.

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