Skip to main content
Glama

List compartments

list_compartments
Read-onlyIdempotent

Recursively lists compartments in an OCI tenancy, excluding those outside the configured allowlist. Enables discovery of accessible compartments for resource mapping and Terraform generation.

Instructions

List compartments in the tenancy (recursively). Compartments outside the allowlist are filtered out.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootCompartmentIdNoOCID to list under (defaults to the tenancy root)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint. The description adds valuable behavioral context beyond annotations: recursive traversal and allowlist filtering. This alerts the agent that results may be incomplete due to filtering, which is important for interpreting absence of compartments.

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?

Two short sentences with no filler. The primary purpose is front-loaded, and the recursive/filtering behavior is stated immediately after. Every sentence contributes useful information.

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, one-parameter list operation with rich annotations, the description covers the key non-obvious behaviors: recursion and allowlist filtering. It does not describe result shape or pagination, but no output schema exists and the tool is straightforward. The absence of alternative-routing guidance is a minor gap, but overall the definition is sufficient for safe and correct invocation.

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?

The only parameter, rootCompartmentId, is fully described in the schema with a default behavior. The description does not add parameter-specific details, but because schema coverage is 100%, the baseline of 3 applies. No additional meaning is needed here.

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 states a specific action and resource: 'List compartments in the tenancy (recursively).' It clearly identifies scope (tenancy) and a key behavior (recursive listing). This distinguishes it from siblings like list_regions and list_compartment_resources, which target different resources.

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 tool's purpose implies when to use it—when compartments need to be enumerated. However, it does not explicitly mention alternatives or conditions for choosing another tool, such as search_resources or list_compartment_resources. The allowlist filtering note offers some context but no direct comparison with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

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