Skip to main content
Glama
ivossos

FCCS MCP Agentic Server

by ivossos

get_dimension_hierarchy

Build parent-child hierarchies for Oracle EPM Cloud FCCS dimensions to visualize relationships and structure. Specify dimension, optional starting member, depth, and metadata inclusion.

Instructions

Build a parent-child hierarchy for a dimension / Construir hierarquia pai-filho

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dimension_nameYesDimension to explore
member_nameNoStart from a specific member (optional)
depthNoDepth limit for the hierarchy (default: 5)
include_metadataNoInclude raw metadata for each node

Implementation Reference

  • The main tool handler function that executes get_dimension_hierarchy logic, including caching, client delegation, and response formatting.
    async def get_dimension_hierarchy(
        dimension_name: str,
        member_name: Optional[str] = None,
        depth: int = 5,
        include_metadata: bool = False
    ) -> dict[str, Any]:
        """Build a parent-child hierarchy for a dimension / Construir hierarquia pai-filho de uma dimensao.
    
        Args:
            dimension_name: Dimension to explore.
            member_name: Start from a specific member (optional).
            depth: Depth limit for the hierarchy (default: 5).
            include_metadata: Include raw metadata for each node.
    
        Returns:
            dict: Hierarchy tree structure.
        """
        cache = get_cache_service()
        cache_key = f"hierarchy:{dimension_name}:{member_name}:{depth}:{include_metadata}"
        
        if cache:
            cached_data = cache.get(cache_key)
            if cached_data:
                return {"status": "success", "data": cached_data, "source": "cache"}
    
        hierarchy = await _client.get_dimension_hierarchy(
            _app_name, dimension_name, member_name, depth, include_metadata
        )
        
        if cache and hierarchy:
            cache.set(cache_key, hierarchy, ttl_seconds=3600)  # Cache for 1 hour
            
        return {"status": "success", "data": hierarchy, "source": "fccs"}
  • Input schema and metadata definition for the get_dimension_hierarchy tool within TOOL_DEFINITIONS.
    {
        "name": "get_dimension_hierarchy",
        "description": "Build a parent-child hierarchy for a dimension / Construir hierarquia pai-filho",
        "inputSchema": {
            "type": "object",
            "properties": {
                "dimension_name": {
                    "type": "string",
                    "description": "Dimension to explore",
                },
                "member_name": {
                    "type": "string",
                    "description": "Start from a specific member (optional)",
                },
                "depth": {
                    "type": "number",
                    "description": "Depth limit for the hierarchy (default: 5)",
                },
                "include_metadata": {
                    "type": "boolean",
                    "description": "Include raw metadata for each node",
                },
            },
            "required": ["dimension_name"],
        },
    },
  • Registration of the get_dimension_hierarchy tool handler in the central TOOL_HANDLERS dictionary.
    "get_dimension_hierarchy": dimensions.get_dimension_hierarchy,
  • Core helper method in FccsClient that implements the hierarchy building logic from dimension members, used by the tool handler.
    async def get_dimension_hierarchy(
        self,
        app_name: str,
        dimension_name: str,
        member_name: Optional[str] = None,
        depth: int = 5,
        include_metadata: bool = False
    ) -> dict[str, Any]:
        """Get dimension hierarchy / Obter hierarquia da dimensao."""
        members_response = await self.get_members(app_name, dimension_name)
    
        # Extract member items
        member_items = (
            members_response.get("items")
            or members_response.get("members")
            or (members_response if isinstance(members_response, list) else [])
        )
    
        if not member_items:
            return {
                "dimension": dimension_name,
                "requestedMember": member_name,
                "depth": depth,
                "hierarchy": [],
                "note": "No members returned for this dimension."
            }
    
        # Build hierarchy tree
        node_map: dict[str, dict] = {}
    
        for member in member_items:
            name = member.get("memberName") or member.get("name") or member.get("alias")
            if not name or name in node_map:
                continue
    
            parent_name = (
                member.get("parentName")
                or member.get("parent")
                or member.get("parent_member_name")
            )
    
            node_map[name] = {
                "node": {
                    "name": name,
                    "description": member.get("description") or member.get("alias"),
                    **({"metadata": member} if include_metadata else {}),
                    "children": [],
                },
                "parentName": parent_name,
            }
    
        # Link children to parents
        root_nodes = []
        for name, entry in node_map.items():
            parent = entry["parentName"]
            if parent and parent in node_map:
                node_map[parent]["node"]["children"].append(entry["node"])
            else:
                root_nodes.append(entry["node"])
    
        # Prune to requested depth
        def prune_node(node: dict, remaining_depth: int) -> dict:
            pruned = {"name": node["name"]}
            if node.get("description"):
                pruned["description"] = node["description"]
            if include_metadata and node.get("metadata"):
                pruned["metadata"] = node["metadata"]
    
            if remaining_depth > 0 and node.get("children"):
                pruned["children"] = [
                    prune_node(child, remaining_depth - 1)
                    for child in node["children"]
                ]
            else:
                pruned["children"] = []
                if node.get("children"):
                    pruned["truncatedChildren"] = len(node["children"])
    
            return pruned
    
        # Find target nodes
        if member_name:
            target = node_map.get(member_name)
            if not target:
                # Case-insensitive search
                for key, entry in node_map.items():
                    if key.lower() == member_name.lower():
                        target = entry
                        break
            if not target:
                raise ValueError(f"Member '{member_name}' not found in dimension '{dimension_name}'")
            targets = [target["node"]]
        else:
            targets = root_nodes
    
        return {
            "dimension": dimension_name,
            "requestedMember": member_name,
            "depth": depth,
            "totalMembers": len(member_items),
            "hierarchy": [prune_node(node, depth) for node in targets],
        }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions building a hierarchy but fails to explain critical behaviors like whether it returns a tree structure, list, or other format; if it requires specific permissions; or any rate limits. This leaves significant gaps for an agent to understand how to handle the tool effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and front-loaded with the core purpose, but the bilingual repetition ('Construir hierarquia pai-filho') adds redundancy without value. It could be more concise by omitting the translation or integrating it better, though it remains relatively efficient.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a hierarchy-building tool with no annotations and no output schema, the description is incomplete. It does not explain the return format, error conditions, or how results are structured, which are crucial for an agent to use the tool correctly. This leaves too many unknowns for effective operation.

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%, so the schema already documents all parameters well. The description does not add any meaning beyond the schema, such as explaining how 'dimension_name' relates to other tools or what 'include_metadata' entails. With high schema coverage, a baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 ('Build a parent-child hierarchy') and the target resource ('for a dimension'), which is specific and actionable. However, it does not explicitly differentiate from sibling tools like 'get_dimensions' or 'get_members', which might have overlapping functionality in exploring dimension structures.

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. It lacks context on prerequisites, such as whether the dimension must exist or be accessible, and does not mention any sibling tools as alternatives for related tasks, leaving usage unclear.

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/ivossos/fccs-mcp-ag-server'

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