Skip to main content
Glama
debtstack-ai

DebtStack MCP Server

get_corporate_structure

Retrieve corporate hierarchy and debt distribution to analyze structural subordination and debt positioning within an organization.

Instructions

Get the full corporate structure for a company. Shows parent-subsidiary hierarchy, entity types, and debt at each level. Use to understand structural subordination and where debt sits in the org.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYesCompany ticker (e.g., 'RIG', 'CHTR')

Implementation Reference

  • MCP tool handler that executes get_corporate_structure by calling the API's /entities/traverse endpoint and formatting results
    elif name == "get_corporate_structure":
        ticker = arguments.get("ticker", "").upper()
        body = {
            "start": {"type": "company", "id": ticker},
            "relationships": ["subsidiaries"],
            "direction": "outbound",
            "depth": 10,
            "fields": ["name", "entity_type", "jurisdiction", "is_guarantor", "is_vie", "debt_at_entity"]
        }
        result = api_post("/entities/traverse", body)
    
        data = result.get("data", {})
        start = data.get("start", {})
        entities = data.get("traversal", {}).get("entities", [])
    
        text = f"**Corporate Structure for {start.get('name', ticker)}**\n\n"
        text += f"{len(entities)} entities in structure:\n\n"
        text += "\n".join(format_entity(e) for e in entities)
    
        return [TextContent(type="text", text=text)]
  • Tool schema definition registered with MCP server, defining input parameters and description
    Tool(
        name="get_corporate_structure",
        description=(
            "Get the full corporate structure for a company. "
            "Shows parent-subsidiary hierarchy, entity types, and debt at each level. "
            "Use to understand structural subordination and where debt sits in the org."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "ticker": {
                    "type": "string",
                    "description": "Company ticker (e.g., 'RIG', 'CHTR')"
                }
            },
            "required": ["ticker"]
        }
    ),
  • Tool registration endpoint that returns all available tools including get_corporate_structure
    @app.list_tools()
    async def list_tools() -> list[Tool]:
        """List available DebtStack tools."""
        return [
            Tool(
                name="search_companies",
                description=(
                    "Search companies by ticker, sector, leverage ratio, and risk flags. "
                    "Use to find companies with specific characteristics, compare leverage across peers, "
                    "or screen for structural subordination risk. "
                    "Example: 'Find tech companies with leverage above 4x'"
                ),
                inputSchema={
                    "type": "object",
                    "properties": {
                        "ticker": {
                            "type": "string",
                            "description": "Comma-separated tickers (e.g., 'AAPL,MSFT,GOOGL')"
                        },
                        "sector": {
                            "type": "string",
                            "description": "Filter by sector (e.g., 'Technology', 'Energy')"
                        },
                        "min_leverage": {
                            "type": "number",
                            "description": "Minimum leverage ratio"
                        },
                        "max_leverage": {
                            "type": "number",
                            "description": "Maximum leverage ratio"
                        },
                        "has_structural_sub": {
                            "type": "boolean",
                            "description": "Filter for structural subordination"
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Maximum results (default 10)"
                        }
                    },
                    "required": []
                }
            ),
            Tool(
                name="search_bonds",
                description=(
                    "Search bonds by ticker, seniority, yield, spread, and maturity. "
                    "Use for yield hunting, finding high-yield opportunities, or analyzing maturity walls. "
                    "Example: 'Find senior unsecured bonds yielding above 8%'"
                ),
                inputSchema={
                    "type": "object",
                    "properties": {
                        "ticker": {
                            "type": "string",
                            "description": "Company ticker(s)"
                        },
                        "seniority": {
                            "type": "string",
                            "enum": ["senior_secured", "senior_unsecured", "subordinated"],
                            "description": "Bond seniority level"
                        },
                        "min_ytm": {
                            "type": "number",
                            "description": "Minimum yield to maturity (%)"
                        },
                        "has_pricing": {
                            "type": "boolean",
                            "description": "Only bonds with pricing data"
                        },
                        "maturity_before": {
                            "type": "string",
                            "description": "Maturity before date (YYYY-MM-DD)"
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Maximum results (default 10)"
                        }
                    },
                    "required": []
                }
            ),
            Tool(
                name="resolve_bond",
                description=(
                    "Look up a bond by CUSIP, ISIN, or description. "
                    "Use when you have a partial bond identifier and need full details. "
                    "Example: 'RIG 8% 2027' or 'CUSIP 893830AK8'"
                ),
                inputSchema={
                    "type": "object",
                    "properties": {
                        "query": {
                            "type": "string",
                            "description": "Bond identifier - CUSIP, ISIN, or description (e.g., 'RIG 8% 2027')"
                        }
                    },
                    "required": ["query"]
                }
            ),
            Tool(
                name="get_guarantors",
                description=(
                    "Find all entities that guarantee a bond. "
                    "Use to understand guarantee coverage and structural subordination risk. "
                    "Pass a CUSIP or bond description."
                ),
                inputSchema={
                    "type": "object",
                    "properties": {
                        "bond_id": {
                            "type": "string",
                            "description": "Bond CUSIP or identifier"
                        }
                    },
                    "required": ["bond_id"]
                }
            ),
            Tool(
                name="get_corporate_structure",
                description=(
                    "Get the full corporate structure for a company. "
                    "Shows parent-subsidiary hierarchy, entity types, and debt at each level. "
                    "Use to understand structural subordination and where debt sits in the org."
                ),
                inputSchema={
                    "type": "object",
                    "properties": {
                        "ticker": {
                            "type": "string",
                            "description": "Company ticker (e.g., 'RIG', 'CHTR')"
                        }
                    },
                    "required": ["ticker"]
                }
            ),
            Tool(
                name="search_pricing",
                description=(
                    "Get bond pricing from FINRA TRACE. "
                    "Returns current price, yield to maturity, and spread to treasury. "
                    "Use to find distressed bonds or compare relative value."
                ),
                inputSchema={
                    "type": "object",
                    "properties": {
                        "ticker": {
                            "type": "string",
                            "description": "Company ticker(s)"
                        },
                        "cusip": {
                            "type": "string",
                            "description": "Bond CUSIP(s)"
                        },
                        "min_ytm": {
                            "type": "number",
                            "description": "Minimum yield to maturity (%)"
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Maximum results (default 10)"
                        }
                    },
                    "required": []
                }
            ),
            Tool(
                name="search_documents",
                description=(
                    "Search SEC filing sections for specific terms. "
                    "Section types: debt_footnote, credit_agreement, indenture, covenants, mda_liquidity. "
                    "Use to find covenant language, credit agreement terms, or debt descriptions."
                ),
                inputSchema={
                    "type": "object",
                    "properties": {
                        "query": {
                            "type": "string",
                            "description": "Search terms"
                        },
                        "ticker": {
                            "type": "string",
                            "description": "Company ticker(s)"
                        },
                        "section_type": {
                            "type": "string",
                            "enum": ["debt_footnote", "credit_agreement", "indenture", "covenants", "mda_liquidity", "exhibit_21", "guarantor_list"],
                            "description": "Section type to search"
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Maximum results (default 10)"
                        }
                    },
                    "required": ["query"]
                }
            ),
            Tool(
                name="get_changes",
                description=(
                    "See what changed in a company's debt structure since a date. "
                    "Returns new issuances, matured debt, leverage changes, and pricing movements. "
                    "Use to monitor companies for material changes."
                ),
                inputSchema={
                    "type": "object",
                    "properties": {
                        "ticker": {
                            "type": "string",
                            "description": "Company ticker"
                        },
                        "since": {
                            "type": "string",
                            "description": "Compare since date (YYYY-MM-DD)"
                        }
                    },
                    "required": ["ticker", "since"]
                }
            ),
        ]
  • Client SDK async method for get_corporate_structure that wraps the traverse_entities primitive
    async def get_corporate_structure(self, ticker: str) -> Dict[str, Any]:
        """
        Get full corporate structure for a company.
    
        Args:
            ticker: Company ticker symbol
    
        Returns:
            Dictionary with entity hierarchy and debt at each level
        """
        result = await self.traverse_entities(
            start_type="company",
            start_id=ticker,
            relationships=["subsidiaries"],
            direction="outbound",
            depth=10,
            fields=["name", "entity_type", "jurisdiction", "is_guarantor", "is_vie", "debt_at_entity"]
        )
        return result.get("data", {})
  • Helper function that formats corporate structure entity data for display in the MCP tool response
    def format_entity(e: dict) -> str:
        """Format entity data for display."""
        name = e.get('name', 'Unknown')
        etype = e.get('entity_type', 'entity').replace('_', ' ').title()
        jurisdiction = e.get('jurisdiction', '')
    
        parts = [f"• {name} ({etype})"]
        if jurisdiction:
            parts[0] += f" - {jurisdiction}"
    
        if e.get('is_guarantor'):
            parts.append("  ✓ Guarantor")
        if e.get('is_vie'):
            parts.append("  ⚠️ VIE")
        if e.get('debt_at_entity'):
            parts.append(f"  Debt: ${e['debt_at_entity'] / 100_000_000_000:.2f}B")
    
        return "\n".join(parts)
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 of behavioral disclosure. It implies a read-only operation ('Get', 'Shows') and hints at output content (hierarchy, entity types, debt), but lacks details on permissions, rate limits, error handling, or response format. The description adds some context but does not fully compensate for the absence of annotations.

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 concise and front-loaded, with two sentences that efficiently convey purpose and usage without wasted words. Each sentence adds value: the first defines the tool's function, and the second provides application context, making it easy to scan and understand.

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 the tool's complexity (involving hierarchical data and debt analysis) and the absence of annotations and output schema, the description is moderately complete. It outlines what information is retrieved but lacks details on output structure, data freshness, or limitations. For a tool with no structured output documentation, more context on return values would be beneficial.

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 input schema has 100% description coverage, with the 'ticker' parameter well-documented. The description does not add any parameter-specific details beyond what the schema provides, such as format examples or constraints. Since schema coverage is high, the baseline score of 3 is appropriate, as the description does not enhance parameter understanding.

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's purpose with specific verbs ('Get', 'Shows') and resources ('full corporate structure for a company'), detailing what information is retrieved (parent-subsidiary hierarchy, entity types, debt at each level). It distinguishes this tool from siblings like 'search_companies' or 'search_bonds' by focusing on hierarchical structure analysis rather than general searching.

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 provides explicit guidance on when to use this tool ('Use to understand structural subordination and where debt sits in the org.'), giving clear context for its application in financial analysis. However, it does not specify when not to use it or name alternative tools for related tasks, such as using 'search_companies' for basic company info instead.

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/debtstack-ai/debtstack-python'

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