API & MCP
Everything a person can do on Contract Bridge Score Calculator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://playcardsbridgescore.usefulweb.app/api/v1/calculate– run Contract Bridge Score CalculatorGET https://playcardsbridgescore.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Contract Bridge Score Calculator
Scores one Contract Bridge deal by the scoring tables of the Laws of Duplicate Bridge: points for the tricks bid and made, overtricks, the bonus for making a doubled or redoubled contract, slam bonuses and the penalties for undertricks, not vulnerable or vulnerable, doubled or redoubled. Duplicate scoring adds the part-score or game bonus; rubber scoring splits the result into the points below the line (towards game, with your existing part score) and above it, with honours. Enter the other table’s score to get the IMP difference. The Playcards app scores every deal with the same engine.
| Field | Type | Default | Description |
|---|---|---|---|
level | integer | 4 | Contract level. Odd tricks bid: 1 (seven tricks) to 7 (all thirteen). |
strain | select (C, D, H, S, N) | "S" | Trumps |
doubled | select (0, 1, 2) | "0" | Doubled |
vulnerable | boolean | false | Declarer’s side vulnerable |
tricks | integer | 10 | Tricks won by declarer’s side |
scoring | select (duplicate, rubber) | "duplicate" | Scoring |
partScore | integer | 0 | Part score already below the line (rubber). Points the declarer’s side already has towards the current game. |
honours | select (none, four, five, aces) | "none" | Honours in one hand (rubber) |
honoursSide | select (declarer, defenders) | "declarer" | Honours held by |
otherTable | text | — | Other table’s score for the same side (optional). With a score from the other table the tool converts the difference to IMPs. |
Example request
4♠ made with an overtrick, not vulnerable
curl -X POST https://playcardsbridgescore.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"level":4,"strain":"S","tricks":11}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://playcardsbridgescore.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
playcards_bridge_score - Local stdio connector:
node src/mcp-stdio.ts --tool=playcards-bridge-score
{
"mcpServers": {
"playcards-bridge-score": { "type": "http", "url": "https://playcardsbridgescore.usefulweb.app/mcp" }
}
}