Skip to main content
Glama

get_namespace

Retrieve the unique Object Storage namespace identifier required for all storage operations in Oracle Cloud Infrastructure tenancies.

Instructions

Get the Object Storage namespace for the tenancy.

The namespace is a unique identifier for the tenancy in Object Storage.
It's required for all Object Storage operations.

Returns:
    Dictionary with namespace information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the 'get_namespace' tool logic. It retrieves the Object Storage namespace using the provided OCI client and returns it wrapped in a dictionary.
    def get_namespace(object_storage_client: oci.object_storage.ObjectStorageClient) -> Dict[str, Any]:
        """
        Get the Object Storage namespace for the tenancy.
        
        Args:
            object_storage_client: OCI ObjectStorage client
            
        Returns:
            Object Storage namespace details
        """
        try:
            namespace = object_storage_client.get_namespace().data
            
            namespace_details = {
                "namespace": namespace,
            }
            
            logger.info(f"Retrieved Object Storage namespace: {namespace}")
            return namespace_details
            
        except Exception as e:
            logger.exception(f"Error getting namespace: {e}")
            raise
  • Registers the MCP tool named 'get_namespace' by decorating the wrapper function that calls the core handler from resources.py, adding logging and error handling.
    @mcp.tool(name="get_namespace")
    @mcp_tool_wrapper(
        start_msg="Getting Object Storage namespace...",
        success_msg="Retrieved namespace successfully",
        error_prefix="Error getting namespace"
    )
    async def mcp_get_namespace(ctx: Context) -> Dict[str, Any]:
        """
        Get the Object Storage namespace for the tenancy.
    
        The namespace is a unique identifier for the tenancy in Object Storage.
        It's required for all Object Storage operations.
    
        Returns:
            Dictionary with namespace information
        """
        return get_namespace(oci_clients["object_storage"])
  • Imports the get_namespace handler function from tools.resources module for use in tool registration.
    from mcp_server_oci.tools.resources import (
        list_availability_domains,
        list_fault_domains,
        list_images,
        get_image,
        list_shapes,
        get_namespace,
        list_regions,
        get_tenancy_info,
    )
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 states this is a read operation ('Get') and mentions the namespace is a 'unique identifier,' which implies it's a lookup rather than a mutation. However, it doesn't disclose authentication requirements, rate limits, error conditions, or whether the result is cached. The description adds basic context but lacks comprehensive behavioral details.

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 perfectly front-loaded with the core purpose in the first sentence. Each subsequent sentence adds essential context without redundancy. The three-sentence structure efficiently explains what it does, why it matters, and what it returns, with zero wasted words.

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 zero-parameter read-only tool with no output schema, the description is nearly complete. It explains the purpose, importance, and return format ('Dictionary with namespace information'). The main gap is lack of behavioral details like authentication or error handling, but given the tool's simplicity, the description provides sufficient context for basic usage.

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 tool has 0 parameters, and schema description coverage is 100% (empty schema is fully described as having no parameters). The description appropriately doesn't discuss parameters since none exist. A baseline of 4 is appropriate for zero-parameter tools where the schema fully covers the absence of inputs.

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 specific action ('Get the Object Storage namespace for the tenancy') and resource ('Object Storage namespace'), distinguishing it from siblings that retrieve other OCI resources like alarms, databases, or instances. It explicitly identifies what makes this tool unique among the many get_* tools.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'It's required for all Object Storage operations.' This tells the agent when this tool is necessary (as a prerequisite for Object Storage work) and implicitly when not to use it (for non-Object Storage tasks). It effectively positions this as a foundational tool.

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