paytriage
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@paytriagetriage this error: 'AUTH DECLINED response_code=51'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
paytriage
Reads a payment gateway error and tells you what it probably means, what to check next, and whether retrying is safe.
Point it at a log line, an error string, or a whole log file. It answers in plain language instead of a code you have to go look up.
No dependencies. Python 3.8 and up. Works as a CLI, as a library, and as an MCP server an agent can call.
Why
Support and implementation people spend a lot of time turning response_code="51"
into "the customer's card did not have the money, this is not your bug." That
translation lives in people's heads and in bookmarked PDFs. This puts it in a file
you can read, grep, and correct.
The timeout case is the one that matters most. A timeout is not a decline. The transaction may already be authorized on the other side, so a blind retry is how you double-charge someone. paytriage says that out loud every time.
Related MCP server: MerchantGuard MCP Server
Install
git clone https://github.com/Flyingmiata-droid/paytriage.git
cd paytriage
pip install -e .Or skip installing and run it in place with python -m paytriage.cli.
Use it from the command line
$ paytriage 'AUTH DECLINED response_code="51" insufficient funds'
[low] Insufficient funds (decline)
cause: The issuer declined the authorization because the account did not have
enough available balance or credit.
check: Nothing to fix on the integration side. Ask the cardholder to use
another card or retry later.
matched response code: 51
safe to retry: noA whole file, rolled up:
$ paytriage -f examples/gateway.log --summary
lines: 11 matched: 9 unmatched: 2
by severity:
low: 2
medium: 3
high: 2
critical: 2
by signature:
decline.insufficient_funds: 1
transport.tls_handshake: 1
format.signature_mismatch: 1
...Add --json to any call to get machine-readable output.
Use it as a library
from paytriage import triage_line
result = triage_line("SSLError: handshake failure tlsv1 alert protocol version")
result.severity # "critical"
result.retryable # True
result.findings[0].label # "TLS handshake failure"
result.findings[0].fix # what to checkUse it as an MCP server
The server speaks JSON-RPC over stdio and exposes one tool,
triage_payment_error, so an agent can hand it an error and get structured output
back.
python -m paytriage.mcp_serverClaude Desktop or Claude Code config:
{
"mcpServers": {
"paytriage": {
"command": "python",
"args": ["-m", "paytriage.mcp_server"]
}
}
}What it covers
Twenty four signatures across six families:
Declines: insufficient funds, do not honor, expired card, pick up card, invalid number
Verification: AVS mismatch, CVV mismatch
Transport: TLS handshake, certificate expired or untrusted, timeout, connection refused or reset, DNS
API: 401, 403, 429, 5xx
Message format: XML parse, JSON parse, signature or HMAC mismatch, missing required field
Business rules: duplicate transaction, unsupported currency, bad amount, invalid token
Matching is by response code where one is present, and by pattern otherwise. A line can match more than one signature, and results come back worst first.
What it is not
Not fraud scoring, and not a risk engine.
Not connected to any gateway. It reads text you already have, and it makes no network calls.
Not exhaustive. It is a first-pass triage helper. The issuer's own documentation is still the authority on any specific code.
Not a decision maker. Nothing here should auto-retry a payment on its own.
Adding a signature
Everything lives in one table in paytriage/signatures.py. A signature is a
pattern or a set of codes, plus the cause, the fix, and a severity. Add an entry,
add a test, open a pull request. Corrections to the existing wording are just as
welcome as new entries.
Tests
python -m unittest discover -s tests -t .23 tests, no network, no fixtures to download.
License
MIT. See LICENSE.
Available Tools
1 tooltriage_payment_errorA
Triage a payment gateway error string or log excerpt. Returns the likely cause, what to check next, a severity, and whether a retry is safe.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The error message, response body, or log excerpt. | |
| multiline | No | Treat the input as many log lines instead of one. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full transparency burden. It does disclose the core behavioral trait well by enumerating return values (cause, next steps, severity, retry safety). However, it never explicitly states the operation is non-destructive/read-only (only implied by 'triage') and says nothing about edge cases such as empty input, unrecognized formats, or whether triage is heuristic versus calling an external service.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences with zero filler. The purpose is front-loaded first, then the return contract is enumerated. Every clause earns its place, and the length is proportionate to the tool's simplicity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Since there is no output schema, the description correctly takes on the job of explaining return content, which it does thoroughly. Both parameters are covered by the schema, and complexity is low. The only minor gap: it could note the format expectation for text (e.g., an excerpt length limit or what 'multiline' affects) to further reduce ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% — both 'text' and 'multiline' are fully documented with type, requirement, and a description. The tool description's 'error string or log excerpt' roughly mirrors what the schema already says, adding only marginal enrichment (framing 'text' as an excerpt) rather than genuinely new meaning. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Triage') and resource ('payment gateway error string or log excerpt'), and enumerates exactly what it returns: likely cause, what to check next, severity, and retry safety. Though there are no siblings to distinguish from, the purpose is unambiguous and concrete.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The domain is clearly scoped to payment gateway error strings or log excerpts, which effectively conveys when to use it. With no sibling tools, there are no alternatives to exclude, but the 'when' is implicit rather than explicitly framed — no explicit statement like 'use when a payment fails with an unknown downstream reason'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.0- First observed
triage_payment_error
TDQS
With only one tool, there is no possibility of confusion or overlap. The tool's purpose is clearly singular and distinct.
The single tool 'triage_payment_error' follows a clear verb_noun pattern, consistent with best practices. No inconsistency exists in a one-tool set.
The tool count is at the thin end of the spectrum (1 tool), which feels minimal for a server, but the narrow scope of payment error triage makes it borderline acceptable.
The single tool fully addresses the stated purpose of triaging payment errors, providing cause, next steps, severity, and retry safety—no obvious gaps for this focused domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Payment decisions, durable evidence, x402 resource discovery and live gateway status for AI agents.
Cross-border payment & banking intelligence for AI agents: SWIFT/BIC, IBAN, sanctions, FX, tracking.
Payments data, revenue workflows, and merchant-application guidance for AI agents, by Easy Labs.
Check if a counterparty is safe to pay: trust/risk score for AI agents. Scam/phishing screen.
Related MCP Servers
AlicenseAqualityAmaintenanceEnables AI assistants to manage payments via Spreedly API, including gateways, transactions, and payment method tokenization.3242610Apache 2.0- AlicenseNot gradedqualityDmaintenanceProvides AI-native fraud scoring, risk intelligence, and compliance tools for AI agents processing payments across multiple rails.MIT
- AlicenseNot gradedqualityBmaintenanceProvides structured error classification and recovery guidance for MCP agents, turning opaque failures into actionable retry and state information.17MIT
- AlicenseNot gradedqualityBmaintenanceClassifies agent errors and provides clear recovery actions (retry, escalate) with configurable categories and strategies, plus MCP tools for direct agent use.8MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Flyingmiata-droid/paytriage'
If you have feedback or need assistance with the MCP directory API, please join our Discord server