Skip to main content
Glama

list_db_nodes

Retrieve database nodes from Oracle Cloud Infrastructure compartments, with optional filtering by DB System to manage and monitor database resources.

Instructions

List DB Nodes in a compartment, optionally filtered by DB System.
Note: compartment_id is always required by the SDK.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compartment_idYes
db_system_idNo

Implementation Reference

  • Core implementation of list_db_nodes tool handler. Calls OCI DatabaseClient.list_db_nodes API with pagination, extracts and formats node details (id, db_system_id, hostname, vnic_id, lifecycle_state, storage size, time_created). Supports filtering by db_system_id or lists from all systems in compartment.
    def list_db_nodes(
        database_client: oci.database.DatabaseClient,
        db_system_id: Optional[str] = None,
        compartment_id: Optional[str] = None
    ) -> List[Dict[str, Any]]:
        """
        List DB Nodes for a DB System, or for all DB Systems in a compartment.
        Always requires compartment_id for the SDK call.
        """
        try:
            if not compartment_id:
                raise ValueError("compartment_id is required")
    
            nodes: List[Dict[str, Any]] = []
    
            if db_system_id:
                # Correct usage: positional compartment_id + snake_case db_system_id
                resp = oci.pagination.list_call_get_all_results(
                    database_client.list_db_nodes,
                    compartment_id,
                    db_system_id=db_system_id,
                )
                for n in resp.data:
                    nodes.append({
                        "id": n.id,
                        "db_system_id": n.db_system_id,
                        "hostname": getattr(n, "hostname", None),
                        "vnic_id": getattr(n, "vnic_id", None),
                        "lifecycle_state": n.lifecycle_state,
                        "software_storage_size_in_gb": getattr(n, "software_storage_size_in_gb", None),
                        "time_created": str(getattr(n, "time_created", "")),
                    })
            else:
                systems = list_db_systems(database_client, compartment_id)
                for sys in systems:
                    resp = oci.pagination.list_call_get_all_results(
                        database_client.list_db_nodes,
                        compartment_id,
                        db_system_id=sys["id"],
                    )
                    for n in resp.data:
                        nodes.append({
                            "id": n.id,
                            "db_system_id": n.db_system_id,
                            "hostname": getattr(n, "hostname", None),
                            "vnic_id": getattr(n, "vnic_id", None),
                            "lifecycle_state": n.lifecycle_state,
                            "software_storage_size_in_gb": getattr(n, "software_storage_size_in_gb", None),
                            "time_created": str(getattr(n, "time_created", "")),
                        })
    
            logger.info(f"Found {len(nodes)} DB Nodes")
            return nodes
        except Exception as e:
            logger.exception(f"Error listing DB Nodes: {e}")
            raise
  • MCP tool registration for "list_db_nodes". Uses @mcp.tool decorator on a wrapper function that injects oci_clients["database"] client and calls the core handler from dbsystems.py. Input schema inferred from signature: compartment_id (str, required), db_system_id (str, optional).
    @mcp.tool(name="list_db_nodes")
    @mcp_tool_wrapper(
        start_msg="Listing DB Nodes in compartment {compartment_id}...",
        error_prefix="Error listing DB Nodes"
    )
    async def mcp_list_db_nodes(ctx: Context, compartment_id: str, db_system_id: Optional[str] = None) -> List[Dict[str, Any]]:
        """
        List DB Nodes in a compartment, optionally filtered by DB System.
        Note: compartment_id is always required by the SDK.
        """
        return list_db_nodes(
            oci_clients["database"],
            db_system_id=db_system_id,
            compartment_id=compartment_id,
        )
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions that 'compartment_id is always required by the SDK', which adds useful behavioral context about mandatory parameters. However, it doesn't disclose other traits like whether this is a read-only operation (implied by 'List'), potential rate limits, pagination behavior, or what the output looks like (no output schema exists).

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 extremely concise with two sentences that directly address purpose and a key behavioral note. It is front-loaded with the main action and resource, and the second sentence adds necessary context without redundancy. Every word earns its place.

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 no annotations, 0% schema coverage, and no output schema, the description is minimally complete. It covers the basic purpose and hints at parameter usage, but lacks details on behavior, output format, error conditions, or sibling differentiation. For a simple list tool, this is adequate but has clear gaps.

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 0%, so the description must compensate. It explains that 'compartment_id is always required' and mentions optional filtering by 'DB System', which maps to the two parameters (compartment_id and db_system_id). However, it doesn't provide details on parameter formats, valid values, or examples, leaving gaps in semantic understanding.

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 action ('List') and resource ('DB Nodes in a compartment'), with optional filtering by DB System. It distinguishes from sibling tools like 'get_db_node' (singular) and 'list_db_systems', but doesn't explicitly differentiate from other list tools like 'list_databases' or 'list_instances' beyond the resource name.

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 'optionally filtered by DB System' and notes that 'compartment_id is always required by the SDK', which provides some guidance on parameter requirements. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_db_node' for single nodes or 'list_db_systems' for systems, nor does it mention 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/jopsis/mcp-server-oci'

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