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
| Name | Type | Required | Description |
|---|---|---|---|
deck_id | string | yes | The deck ID returned by new_deck (e.g. “3p40paa87x90”). |
count | number | no | Number 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
| Field | Type | Description |
|---|---|---|
deck_id | string | Unique identifier for the deck |
cards | array | Array of cards drawn |
remaining | number | Number 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.