draw_cards

Pack: deckofcards · Endpoint: https://gateway.pipeworx.io/deckofcards/mcp

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

Parameters

NameTypeRequiredDescription
deck_idstringyesThe deck ID returned by new_deck (e.g. “3p40paa87x90”).
countnumbernoNumber of cards to draw. Defaults to 1.

Example call

Arguments

{
  "deck_id": "3p40paa87x90"
}

curl

curl -X POST https://gateway.pipeworx.io/deckofcards/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"draw_cards","arguments":{"deck_id":"3p40paa87x90"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('draw_cards', {
  "deck_id": "3p40paa87x90"
});

More examples

{
  "deck_id": "3p40paa87x90",
  "count": 5
}

Response shape

Always returns: deck_id, cards, remaining

FieldTypeDescription
deck_idstringUnique identifier for the deck
cardsarrayArray of cards drawn
remainingnumberNumber of cards remaining in the deck
Full JSON Schema
{
  "type": "object",
  "properties": {
    "deck_id": {
      "type": "string",
      "description": "Unique identifier for the deck"
    },
    "cards": {
      "type": "array",
      "description": "Array of cards drawn",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Card code (e.g., '2H', 'AS')"
          },
          "value": {
            "type": "string",
            "description": "Card value (e.g., '2', 'ACE', 'KING')"
          },
          "suit": {
            "type": "string",
            "description": "Card suit (e.g., 'HEARTS', 'DIAMONDS')"
          },
          "image": {
            "type": "string",
            "description": "URL to card image"
          }
        },
        "required": [
          "code",
          "value",
          "suit",
          "image"
        ]
      }
    },
    "remaining": {
      "type": "number",
      "description": "Number of cards remaining in the deck"
    }
  },
  "required": [
    "deck_id",
    "cards",
    "remaining"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "deckofcards": {
      "url": "https://gateway.pipeworx.io/deckofcards/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026