Skip to main content
Glama

list_boot_volumes

Retrieve boot volumes in an Oracle Cloud Infrastructure compartment to manage storage resources, view size and state details, and identify source images for compute instances.

Instructions

List all boot volumes in a compartment.

Args:
    compartment_id: OCID of the compartment to list boot volumes from
    availability_domain: Optional AD to filter boot volumes

Returns:
    List of boot volumes with their size, state, and source image information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compartment_idYes
availability_domainNo

Implementation Reference

  • Core handler function implementing the tool logic: lists boot volumes using OCI SDK, handles pagination with oci.pagination.list_call_get_all_results, extracts and formats relevant fields from boot volume objects.
    def list_boot_volumes(block_storage_client: oci.core.BlockstorageClient, 
                          availability_domain: str, compartment_id: str) -> List[Dict[str, Any]]:
        """
        List all boot volumes in a compartment and availability domain.
        
        Args:
            block_storage_client: OCI BlockStorage client
            availability_domain: Availability domain name
            compartment_id: OCID of the compartment
            
        Returns:
            List of boot volumes with their details
        """
        try:
            boot_volumes_response = oci.pagination.list_call_get_all_results(
                block_storage_client.list_boot_volumes,
                availability_domain,
                compartment_id
            )
            
            boot_volumes = []
            for boot_volume in boot_volumes_response.data:
                boot_volumes.append({
                    "id": boot_volume.id,
                    "display_name": boot_volume.display_name,
                    "compartment_id": boot_volume.compartment_id,
                    "availability_domain": boot_volume.availability_domain,
                    "size_in_mbs": boot_volume.size_in_mbs,
                    "size_in_gbs": boot_volume.size_in_gbs,
                    "lifecycle_state": boot_volume.lifecycle_state,
                    "time_created": str(boot_volume.time_created),
                    "is_hydrated": boot_volume.is_hydrated,
                    "vpus_per_gb": boot_volume.vpus_per_gb,
                    "is_auto_tune_enabled": boot_volume.is_auto_tune_enabled,
                    "auto_tuned_vpus_per_gb": boot_volume.auto_tuned_vpus_per_gb,
                })
            
            logger.info(f"Found {len(boot_volumes)} boot volumes in compartment {compartment_id}")
            return boot_volumes
            
        except Exception as e:
            logger.exception(f"Error listing boot volumes: {e}")
            raise
  • Registers the 'list_boot_volumes' tool with MCP using @mcp.tool decorator. Wraps the core handler with mcp_tool_wrapper for logging, error handling, and OCI client access. Defines input parameters and docstring for schema inference. Note: argument order swapped compared to core handler (compartment_id before availability_domain).
    @mcp.tool(name="list_boot_volumes")
    @mcp_tool_wrapper(
        start_msg="Listing boot volumes in compartment {compartment_id}...",
        error_prefix="Error listing boot volumes"
    )
    async def mcp_list_boot_volumes(ctx: Context, compartment_id: str, availability_domain: Optional[str] = None) -> List[Dict[str, Any]]:
        """
        List all boot volumes in a compartment.
    
        Args:
            compartment_id: OCID of the compartment to list boot volumes from
            availability_domain: Optional AD to filter boot volumes
    
        Returns:
            List of boot volumes with their size, state, and source image information
        """
        return list_boot_volumes(oci_clients["block_storage"], compartment_id, availability_domain)
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 states this is a list operation (implying read-only) and describes the return format, but lacks critical details like pagination behavior, rate limits, authentication requirements, or error conditions for a cloud API tool.

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 efficiently structured with a clear purpose statement followed by separate Args and Returns sections. Every sentence adds value with no wasted words, making it easy to parse 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?

For a simple list tool with 2 parameters and no output schema, the description covers the basics (purpose, parameters, return format) adequately. However, without annotations or output schema, it should ideally mention more behavioral aspects like pagination or error handling to be fully complete.

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 both parameters beyond the schema (0% coverage). It explains that 'compartment_id' identifies where to list from and 'availability_domain' is an optional filter, clarifying their roles. However, it doesn't specify format details like OCID structure or AD naming conventions.

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 resource ('boot volumes') with scope ('in a compartment'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_boot_volume' (singular) or other list 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 like 'get_boot_volume' (for a specific volume) or other list tools. It mentions optional filtering by availability_domain but doesn't explain when this is useful or what happens if omitted.

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