Deck of Cards

liveGamesDeveloper

Create, shuffle, and draw from virtual playing card decks via deckofcardsapi.com

3tools
0msauth
free tier50 calls/day

Tools

new_deck

Create a shuffled deck of playing cards. Returns deck_id and remaining count. Use deck_count to combine multiple decks (e.g., 2 for 104 cards).

Parameters
NameTypeDescription
countoptnumberNumber of standard 52-card decks to combine and shuffle. Defaults to 1.
▶Try it
draw_cardsrequired: deck_id

Draw cards from a deck. Returns card details (suit, value) and remaining count. Specify count to draw multiple cards at once.

Parameters
NameTypeDescription
deck_idreqstringThe deck ID returned by new_deck (e.g. "3p40paa87x90").
countoptnumberNumber of cards to draw. Defaults to 1.
▶Try it
shuffle_deckrequired: deck_id

Reshuffle a deck and reset all drawn cards back in. Returns updated remaining card count.

Parameters
NameTypeDescription
deck_idreqstringThe deck ID to shuffle (e.g. "3p40paa87x90").
▶Try it

Test with curl

The gateway speaks JSON-RPC 2.0 over HTTP POST. You can test any pack directly from the terminal.

List available tools
bash
curl -X POST https://gateway.pipeworx.io/deckofcards/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Call a tool
bash
curl -X POST https://gateway.pipeworx.io/deckofcards/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"new_deck","arguments":{}}}'

Use with the SDK

Install @pipeworx/sdk to call tools from any TypeScript/Node project.

TypeScript
import { Pipeworx } from '@pipeworx/sdk';
const px = new Pipeworx();
const result = await px.call("new_deck", {});
ask_pipeworx
// Or ask in plain English:
const answer = await px.ask("create, shuffle, and draw from virtual playing card decks via deckofcardsapi");