Skip to main content
Glama

list_compartments

Resolve an OCI compartment name to its OCID by listing compartments under a parent or across the tenancy, for use with other tools.

Instructions

Lists compartments by name and/or parent compartment. Use this to resolve a compartment name (e.g. "cpLinux") to its OCID before calling other tools. Defaults to searching the entire tenancy tree from the root compartment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoExact compartment name to filter by (e.g. "cpLinux", "cpFiles")
compartmentIdNoParent compartment OCID to search under (default: tenancy root)
includeSubtreeNoSearch the whole hierarchy below the parent compartment (default: true)
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. It discloses the default behavior (searching the entire tenancy tree from the root) and the filtering options, which is useful. However, it does not describe the return format (e.g., list of compartments with OCIDs), pagination, or error behavior, leaving some gaps.

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 two sentences long, immediately states the primary action, and provides a concrete example. Every sentence serves a purpose with no redundant filler, making it highly efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 no output schema and no annotations, the description covers the essential behavior: filtering rationale, default scope, and intended use case. It falls slightly short by not stating the return structure explicitly, but the inference that OCIDs are returned is strong given the stated purpose.

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 100%, with each parameter already clearly described (exact name match, parent compartment, includeSubtree default true). The description adds context about the tenancy-wide default but does not significantly enhance parameter understanding beyond the schema, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists compartments by name and/or parent compartment, with a specific verb ('Lists') and resource ('compartments'). It also distinguishes its purpose by noting it resolves compartment names to OCIDs before calling other tools, setting it apart from sibling tools like list_instances or list_vcns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says to use this tool to resolve a compartment name to its OCID before calling other tools, providing clear context. It does not explicitly name alternatives or when not to use it, but the guidance is strong enough for an agent to select it appropriately.

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

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