← All blueprints

Dispute Responder Autogen

blueprint · 4 agents · 2 MCP servers
688★ stars
82forks
4.6rating

What it does

A gatherer collects the disputed charge, the customer's transaction history, and any prior disputes from Stripe. Two agents then debate: an advocate assembles the strongest legitimate-charge argument, and a risk reviewer counters it and flags weak or misleading claims. They loop until the risk reviewer signs off or the round limit is reached. A drafter turns the agreed case into an evidence packet, and the flow pauses for explicit human approval before anything is submitted. No funds move and nothing is filed automatically.

The cast · 4 agents

Risk Reviewerriskreasoning

Argue the card network's side. Challenge every claim in the advocate's case, flag anything unsupported or misleading, and estimate the odds of winning. Return an object with a 'signedOff' boolean and specific objections. Sign off only when the case is honest and well-supported.

no tools · reasoning only
Drafterdrafterfast

Turn the agreed case into a clean evidence packet: the narrative, the supporting facts, and the documents to attach. Save it to a file. Do not submit anything.

fs.write_file
Advocateadvocatereasoning

Build the strongest honest case that this charge was legitimate, citing the gathered evidence. If you received a review, address every objection. Never invent facts that are not in the context.

no tools · reasoning only
Gatherergathererfast

Pull the disputed charge, the customer's past transactions, and any earlier disputes from this customer. Report the facts only. Flag missing evidence.

pay.get_chargepay.list_disputes

Flow

Gatherercontext
↻ loop until review.signedOff == true · max 3
Advocateargument
Risk Reviewerreview
Drafterpacket
askpacket

Interface

Inputs
disputeIdstring
The Stripe dispute id to respond to.
Outputs
packetstring
The approved evidence packet, ready for a human to submit.

Depends on · 2 MCP servers

com.stripe/payments-mcpnot in the registry yetpay
io.github.modelcontextprotocol/filesystemnot in the registry yetfs
⤓ Export runnable code
# Generated by @socketcat/compiler for target: langgraph
# blueprint: com.socketcat/dispute-responder v1.0.0   schema: socketcat.dev/blueprint/v0
# This code is yours. Edit it freely. The socketcat_runtime helper is optional and can be vendored.

from typing import TypedDict
from langgraph.graph import StateGraph, START, END
import socketcat_runtime as _rt

class State(TypedDict, total=False):
    disputeId: object
    packet: object
    context: object
    __loop_1: object
    argument: object
    review: object

def node_AgentInvoke_0(state):
    return _rt.run_agent("gatherer", state, {"disputeId":"disputeId"}, "context")

def node_LoopHeader_1(state):
    return {}

def node_LoopTick_2(state):
    return {"__loop_1": state.get("__loop_1", 0) + 1}

def node_Nop_3(state):
    return {}

def node_AgentInvoke_4(state):
    return _rt.run_agent("advocate", state, {"review":"review","context":"context"}, "argument")

def node_AgentInvoke_5(state):
    return _rt.run_agent("risk", state, {"argument":"argument"}, "review")

def node_AgentInvoke_6(state):
    return _rt.run_agent("drafter", state, {"argument":"argument"}, "packet")

def node_Ask_7(state):
    return _rt.run_ask("Review the evidence packet. Approve to file this dispute response, or send it back with notes.", state, "packet")

def route_LoopHeader_1(state):
    count = state.get("__loop_1", 0)
    return "exit" if (_rt.cond("review.signedOff == true", state) or count >= 3) else "loop"

def build():
    b = StateGraph(State)
    b.add_node("AgentInvoke_0", node_AgentInvoke_0)
    b.add_node("LoopHeader_1", node_LoopHeader_1)
    b.add_node("LoopTick_2", node_LoopTick_2)
    b.add_node("Nop_3", node_Nop_3)
    b.add_node("AgentInvoke_4", node_AgentInvoke_4)
    b.add_node("AgentInvoke_5", node_AgentInvoke_5)
    b.add_node("AgentInvoke_6", node_AgentInvoke_6)
    b.add_node("Ask_7", node_Ask_7)
    b.add_edge(START, "AgentInvoke_0")
    b.add_edge("AgentInvoke_0", "AgentInvoke_4")
    b.add_conditional_edges("LoopHeader_1", route_LoopHeader_1, {"loop": "AgentInvoke_4", "exit": "Nop_3"})
    b.add_edge("LoopTick_2", "LoopHeader_1")
    b.add_edge("Nop_3", "AgentInvoke_6")
    b.add_edge("AgentInvoke_4", "AgentInvoke_5")
    b.add_edge("AgentInvoke_5", "LoopTick_2")
    b.add_edge("AgentInvoke_6", "Ask_7")
    b.add_edge("Ask_7", END)
    return b.compile()

INPUTS = ["disputeId"]
OUTPUTS = ["packet"]

if __name__ == "__main__":
    _rt.main(build, INPUTS, OUTPUTS)
blueprint.json (the portable format)
{
  "id": "com.socketcat/dispute-responder",
  "flow": {
    "type": "sequence",
    "blocks": [
      {
        "in": {
          "disputeId": "disputeId"
        },
        "out": "context",
        "use": "gatherer",
        "type": "agent"
      },
      {
        "max": 3,
        "type": "loop",
        "until": "review.signedOff == true",
        "blocks": [
          {
            "in": {
              "review": "review",
              "context": "context"
            },
            "out": "argument",
            "use": "advocate",
            "type": "agent"
          },
          {
            "in": {
              "argument": "argument"
            },
            "out": "review",
            "use": "risk",
            "type": "agent"
          }
        ]
      },
      {
        "in": {
          "argument": "argument"
        },
        "out": "packet",
        "use": "drafter",
        "type": "agent"
      },
      {
        "out": "packet",
        "type": "ask",
        "prompt": "Review the evidence packet. Approve to file this dispute response, or send it back with notes."
      }
    ]
  },
  "tags": [
    "payments",
    "disputes",
    "debate",
    "human-in-the-loop"
  ],
  "title": "Dispute Responder",
  "agents": {
    "risk": {
      "model": {
        "hint": "reasoning"
      },
      "title": "Risk Reviewer",
      "output": {
        "type": "object",
        "required": [
          "signedOff"
        ],
        "properties": {
          "signedOff": {
            "type": "boolean"
          },
          "objections": {
            "type": "string"
          }
        }
      },
      "instructions": "Argue the card network's side. Challenge every claim in the advocate's case, flag anything unsupported or misleading, and estimate the odds of winning. Return an object with a 'signedOff' boolean and specific objections. Sign off only when the case is honest and well-supported."
    },
    "drafter": {
      "model": {
        "hint": "fast"
      },
      "title": "Drafter",
      "tools": [
        "fs.write_file"
      ],
      "instructions": "Turn the agreed case into a clean evidence packet: the narrative, the supporting facts, and the documents to attach. Save it to a file. Do not submit anything."
    },
    "advocate": {
      "model": {
        "hint": "reasoning"
      },
      "title": "Advocate",
      "instructions": "Build the strongest honest case that this charge was legitimate, citing the gathered evidence. If you received a review, address every objection. Never invent facts that are not in the context."
    },
    "gatherer": {
      "model": {
        "hint": "fast"
      },
      "title": "Gatherer",
      "tools": [
        "pay.get_charge",
        "pay.list_disputes"
      ],
      "instructions": "Pull the disputed charge, the customer's past transactions, and any earlier disputes from this customer. Report the facts only. Flag missing evidence."
    }
  },
  "estate": {
    "review": {
      "type": "object",
      "description": "The risk reviewer's verdict, including a signedOff flag."
    },
    "context": {
      "type": "object",
      "description": "The gathered charge, customer history, and prior disputes."
    },
    "argument": {
      "type": "object",
      "description": "The advocate's current case for the charge being legitimate."
    }
  },
  "$schema": "socketcat.dev/blueprint/v0",
  "authors": [
    {
      "url": "https://socketcat.com",
      "name": "SocketCat"
    }
  ],
  "license": "MIT",
  "servers": [
    {
      "ref": "com.stripe/payments-mcp",
      "alias": "pay"
    },
    {
      "ref": "io.github.modelcontextprotocol/filesystem",
      "alias": "fs"
    }
  ],
  "summary": "Builds a payment-dispute evidence packet through an advocate-versus-risk debate, then waits for a human to approve before filing.",
  "targets": [
    "*"
  ],
  "version": "1.0.0",
  "interface": {
    "inputs": {
      "disputeId": {
        "type": "string",
        "description": "The Stripe dispute id to respond to."
      }
    },
    "outputs": {
      "packet": {
        "type": "string",
        "description": "The approved evidence packet, ready for a human to submit."
      }
    }
  },
  "extensions": {
    "com.autogen": {
      "chat": "group"
    }
  },
  "description": "A gatherer collects the disputed charge, the customer's transaction history, and any prior disputes from Stripe. Two agents then debate: an advocate assembles the strongest legitimate-charge argument, and a risk reviewer counters it and flags weak or misleading claims. They loop until the risk reviewer signs off or the round limit is reached. A drafter turns the agreed case into an evidence packet, and the flow pauses for explicit human approval before anything is submitted. No funds move and nothing is filed automatically."
}

More in Finance & legal

Browse all →

Invoice Match

com.socketcat/invoice-match
Custom

Reads an incoming invoice, matches it against the purchase order and receipt in your database, and branches: clean ones queue for approval, mismatches get a written exception.

11453 servers
149

Contract Redline

com.socketcat/contract-redline
LangGraph

Extracts a contract's clauses, checks each against your playbook, and loops a redliner against a reviewer until it's clean — then a lawyer approves.

11243 servers
146

Revenue Reconciler

com.socketcat/revenue-reconciler
LangGraph

Pulls Stripe charges and your warehouse's invoice records for the period in parallel, reconciles them line by line, and reports only the discrepancies — with likely causes.

10684 servers
136