Skip to main content
Glama
debtstack-ai

DebtStack MCP Server

get_changes

Track changes in a company's debt structure over time to monitor new issuances, maturities, leverage shifts, and pricing movements for financial analysis.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYesCompany ticker
sinceYesCompare since date (YYYY-MM-DD)

Implementation Reference

  • Tool registration - defines the get_changes tool with name, description, and input schema (ticker and since parameters)
    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"]
        }
    ),
  • Tool handler - executes get_changes logic by calling API and formatting the response with new debt, removed debt, metric changes, and summary
    elif name == "get_changes":
        ticker = arguments.get("ticker", "").upper()
        since = arguments.get("since", "")
        result = api_get(f"/companies/{ticker}/changes", {"since": since})
    
        data = result.get("data", {})
        changes = data.get("changes", {})
    
        text = f"**Changes for {data.get('company_name', ticker)}**\n"
        text += f"Comparing {data.get('snapshot_date', '?')} → {data.get('current_date', 'now')}\n\n"
    
        # New debt
        new_debt = changes.get("new_debt", [])
        if new_debt:
            text += f"**New Debt ({len(new_debt)})**\n"
            for d in new_debt:
                text += f"• {d.get('name', '?')} - ${d.get('principal', 0) / 100_000_000_000:.2f}B\n"
            text += "\n"
    
        # Removed debt
        removed = changes.get("removed_debt", [])
        if removed:
            text += f"**Removed/Matured Debt ({len(removed)})**\n"
            for d in removed:
                text += f"• {d.get('name', '?')} ({d.get('reason', 'removed')})\n"
            text += "\n"
    
        # Metric changes
        metrics = changes.get("metric_changes", {})
        if metrics:
            text += "**Metric Changes**\n"
            for name, vals in metrics.items():
                if isinstance(vals, dict) and 'previous' in vals:
                    prev = vals['previous']
                    curr = vals['current']
                    if isinstance(prev, (int, float)) and isinstance(curr, (int, float)):
                        change = curr - prev
                        sign = "+" if change > 0 else ""
                        text += f"• {name}: {prev} → {curr} ({sign}{change})\n"
            text += "\n"
    
        summary = data.get("summary", {})
        if summary:
            text += "**Summary**\n"
            if summary.get("new_issuances"):
                text += f"• New issuances: {summary['new_issuances']}\n"
            if summary.get("maturities"):
                text += f"• Maturities: {summary['maturities']}\n"
            if summary.get("net_debt_change"):
                change = summary['net_debt_change'] / 100_000_000_000
                text += f"• Net debt change: ${change:+.2f}B\n"
    
        return [TextContent(type="text", text=text)]
  • API helper function - makes GET requests to DebtStack API with authentication headers
    def api_get(endpoint: str, params: dict = None) -> dict:
        """Make GET request to DebtStack API."""
        response = httpx.get(
            f"{BASE_URL}{endpoint}",
            params=params,
            headers=get_headers(),
            timeout=30.0
        )
        response.raise_for_status()
        return response.json()
  • Authentication helper - generates headers with API key for requests
    def get_headers() -> dict:
        """Get API headers."""
        if not API_KEY:
            raise ValueError("DEBTSTACK_API_KEY environment variable not set")
        return {
            "X-API-Key": API_KEY,
            "Content-Type": "application/json",
        }
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses the return content (new issuances, matured debt, leverage changes, pricing movements) which is valuable behavioral context. However, it lacks details on permissions, rate limits, error conditions, or data freshness that would be helpful for a financial data tool.

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 sentences with zero waste. First sentence states purpose and returns, second provides usage guidance. Every word earns its place, and the structure is front-loaded with core functionality.

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 2-parameter tool with no annotations and no output schema, the description provides good context about what the tool does and when to use it. It specifies the return content, which partially compensates for missing output schema. However, it could better address potential limitations or data sources.

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 both parameters fully. The description adds context about what 'since' means ('Compare since date') and implies the ticker identifies a company, but doesn't provide additional syntax, format, or validation details beyond what the schema provides.

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 ('See what changed') and resource ('a company's debt structure'), with explicit scope ('since a date'). It distinguishes from siblings by focusing on debt structure changes rather than structure, guarantors, bonds, companies, documents, or pricing searches.

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?

Explicitly states when to use: 'Use to monitor companies for material changes.' This provides clear context for application. While it doesn't name specific alternatives, the purpose inherently distinguishes it from sibling tools that serve different functions.

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