Skip to main content
Glama
dgalarza

YNAB MCP Server

by dgalarza

delete_scheduled_transaction

Remove scheduled transactions from your YNAB budget to cancel recurring payments or prevent future automated transactions from occurring.

Instructions

Delete a scheduled transaction.

Args:
    budget_id: The ID of the budget (use 'last-used' for default budget)
    scheduled_transaction_id: The ID of the scheduled transaction to delete

Returns:
    JSON string with confirmation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYes
scheduled_transaction_idYes

Implementation Reference

  • MCP tool handler function decorated with @mcp.tool(). Delegates to YNABClient.delete_scheduled_transaction and returns JSON response.
    @mcp.tool()
    async def delete_scheduled_transaction(budget_id: str, scheduled_transaction_id: str) -> str:
        """Delete a scheduled transaction.
    
        Args:
            budget_id: The ID of the budget (use 'last-used' for default budget)
            scheduled_transaction_id: The ID of the scheduled transaction to delete
    
        Returns:
            JSON string with confirmation
        """
        client = get_ynab_client()
        result = await client.delete_scheduled_transaction(budget_id, scheduled_transaction_id)
        return json.dumps(result, indent=2)
  • YNABClient helper method that performs the actual DELETE HTTP request to the YNAB API endpoint for deleting a scheduled transaction.
    async def delete_scheduled_transaction(
        self,
        budget_id: str,
        scheduled_transaction_id: str,
    ) -> dict[str, Any]:
        """Delete a scheduled transaction.
    
        Args:
            budget_id: The budget ID or 'last-used'
            scheduled_transaction_id: The scheduled transaction ID to delete
    
        Returns:
            Confirmation dictionary
        """
        try:
            url = f"{self.api_base_url}/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}"
    
            result = await self._make_request_with_retry("delete", url)
    
            return {
                "scheduled_transaction": result["data"]["scheduled_transaction"],
                "deleted": True,
            }
        except Exception as e:
            raise Exception(f"Failed to delete scheduled transaction: {e}") from e

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/dgalarza/ynab-mcp'

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