Skip to main content
Glama
debtstack-ai

DebtStack MCP Server

get_changes

Identify new issuances, matured debt, leverage changes, and pricing movements in a company's debt structure since a specified date. Monitor material changes for informed 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

  • MCP handler for the get_changes tool. Calls API endpoint /companies/{ticker}/changes with 'since' param, then formats the response into a human-readable text string showing new debt, removed/matured 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)]
  • MCP tool registration for get_changes. Defines the tool name, description, and input schema (ticker and since date).
    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"]
        }
    ),
  • Pydantic input schema GetChangesInput for the LangChain tool, validating ticker (string) and since (date string in YYYY-MM-DD) fields.
    class GetChangesInput(BaseModel):
        """Input for changes tool."""
        ticker: str = Field(
            ...,
            description="Company ticker"
        )
        since: str = Field(
            ...,
            description="Date to compare from (YYYY-MM-DD)"
        )
  • LangChain tool class DebtStackGetChangesTool that wraps the API wrapper's get_changes method and returns JSON results.
    class DebtStackGetChangesTool(BaseTool):
        """Get changes to a company's debt structure since a date."""
    
        name: str = "debtstack_get_changes"
        description: str = (
            "Compare a company's current debt structure against a historical snapshot. "
            "Returns new issuances, matured debt, entity changes, leverage changes, and pricing movements. "
            "Use to monitor portfolio companies for material changes or track refinancing activity."
        )
        args_schema: Type[BaseModel] = GetChangesInput
        api_wrapper: DebtStackAPIWrapper
    
        def _run(
            self,
            ticker: str,
            since: str,
            run_manager: Optional[CallbackManagerForToolRun] = None,
        ) -> str:
            result = self.api_wrapper.get_changes(ticker.upper(), since)
            return json.dumps(result, indent=2, default=str)
  • Core SDK async method get_changes that makes the actual HTTP GET request to /companies/{ticker}/changes with a since parameter and returns the raw JSON response.
    async def get_changes(
        self,
        ticker: str,
        since: Union[str, date],
    ) -> Dict[str, Any]:
        """
        Get changes to a company's debt structure since a date.
    
        Args:
            ticker: Company ticker
            since: Compare changes since this date (YYYY-MM-DD)
    
        Returns:
            Dictionary with:
                - new_debt: Newly issued debt since date
                - removed_debt: Matured/retired debt
                - entity_changes: Added/removed entities
                - metric_changes: Changes to leverage, coverage, etc.
                - pricing_changes: Bond price movements
    
        Example:
            result = await client.get_changes(
                ticker="RIG",
                since="2025-10-01"
            )
            for new_bond in result["data"]["changes"]["new_debt"]:
                print(f"New: {new_bond['name']}")
        """
        params = {"since": str(since)}
    
        client = await self._get_client()
        response = await client.get(f"/companies/{ticker}/changes", params=params)
        response.raise_for_status()
        return response.json()
Behavior3/5

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

The description lists what the tool returns (issuances, maturities, leverage changes, pricing) but does not explicitly state that it is read-only or disclose any side effects. With no annotations, the description carries the burden, and missing explicit read-only status reduces transparency.

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 consists of two succinct sentences: the first defines purpose and returns, the second states use case. No unnecessary words, and key information is front-loaded.

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?

Given no output schema, the description adequately covers return types with examples. However, it lacks explicit mention of read-only nature and handling of empty results or date validation. Overall, it is complete for a simple query tool.

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%, providing basic descriptions for 'ticker' and 'since'. The tool description adds context by linking the 'since' parameter to a date comparison, but does not add significant meaning beyond the schema. Baseline 3 is appropriate.

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 function: 'See what changed in a company's debt structure since a date,' with specific examples of returns. It distinguishes itself from sibling tools like get_corporate_structure and get_guarantors, which focus on static structure or guarantees.

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 description provides a use case: 'Use to monitor companies for material changes,' but does not explicitly state when not to use it or compare it with alternatives. This implies usage without clear exclusions.

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