{
  "name": "madely",
  "title": "Madely fulfillment (sandbox v0)",
  "version": "0.1.0",
  "description": "Find products, get exact whole-dollar quotes, place and track test print-on-demand orders.",
  "transports": [
    {
      "type": "streamable-http",
      "url": "https://api.madely.ai/mcp",
      "auth": "Read tools need no key. For orders send \"Authorization: Bearer <key>\" (mint a free sandbox key with POST /v1/sandbox/keys); if you send none, a sandbox key is minted for you. An api_key tool argument still works but is deprecated."
    }
  ],
  "tools": [
    {
      "name": "get_print_spec",
      "title": "Get print spec",
      "description": "Machine-readable print spec for one product: canvas_px, inches, dpi, bleed, safe_zone, print_zones (with wrap/curvature for mugs), color_mode, accepted_formats, max_file_mb, background (transparent?), orientation, a generation_hint for image models, and template_urls. Check source: \"measured\" is confirmed; the other labels are unconfirmed. Read-only, no API key. Use when: Before you make or generate artwork: you need the exact canvas size, DPI, bleed, safe zone and file formats for one product. Example arguments: {\"product_id\":\"K04\"}. Next: validate_print_file with your finished file.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "product_id"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "description": "product_id or sku from list_products.",
            "examples": [
              "K04"
            ]
          }
        }
      }
    },
    {
      "name": "get_product",
      "title": "Get product",
      "description": "One product with whole-dollar price, photo URL, production time, links and its full print_spec and template_urls. Read-only, no API key. Use when: You already have a product_id and want its price, photo, production time and print spec in one call. Example arguments: {\"product_id\":\"K04\"}. Next: validate_print_file or get_quote.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "product_id"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "examples": [
              "K04",
              "A29"
            ],
            "description": "product id (see the Madely OpenAPI schema)."
          }
        }
      }
    },
    {
      "name": "validate_print_file",
      "title": "Validate print file",
      "description": "Validate an artwork file URL or declared properties (dimensions, format, size, transparency, color mode, content box) against the product's print spec. Returns valid, per-check pass/warn/fail with expected, actual and a fix, a suggested fit, and optionally a placement preview URL. Run it before create_order. Read-only, no API key. Use when: Before create_order: you have a file URL or its declared size and want pass/warn/fail checks with a fix for each. Example arguments: {\"product_id\":\"K04\",\"width_px\":2550,\"height_px\":1155,\"format\":\"png\",\"has_transparency\":false}. Next: get_quote, then create_order.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "product_id"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "description": "product_id or sku.",
            "examples": [
              "K04"
            ]
          },
          "url": {
            "type": "string",
            "description": "Public https URL of the artwork file (optional; it is checked, not downloaded).",
            "examples": [
              "https://example.com/art/mug.png"
            ]
          },
          "placement": {
            "type": "string",
            "description": "A print_zones[].name from the print spec. Defaults to the first zone.",
            "examples": [
              "wrap"
            ]
          },
          "width_px": {
            "type": "integer",
            "examples": [
              2550
            ],
            "description": "width px (see the Madely OpenAPI schema)."
          },
          "height_px": {
            "type": "integer",
            "examples": [
              1155
            ],
            "description": "height px (see the Madely OpenAPI schema)."
          },
          "format": {
            "type": "string",
            "description": "png, jpg, pdf or svg (or a mime type).",
            "examples": [
              "png"
            ]
          },
          "file_size_mb": {
            "type": "number",
            "description": "file size mb (see the Madely OpenAPI schema)."
          },
          "has_transparency": {
            "type": "boolean",
            "description": "has transparency (see the Madely OpenAPI schema)."
          },
          "color_mode": {
            "type": "string",
            "description": "e.g. sRGB or CMYK."
          },
          "content_bbox_px": {
            "type": "object",
            "description": "Bounding box of your text and key art in canvas pixels {x,y,width,height}; checked against the safe zone."
          },
          "fit": {
            "type": "string",
            "enum": [
              "cover",
              "contain",
              "stretch"
            ],
            "description": "fit (see the Madely OpenAPI schema)."
          },
          "preview": {
            "type": "boolean",
            "description": "Also return preview_url, an SVG that shows the file placed on the template."
          }
        }
      }
    },
    {
      "name": "list_products",
      "title": "List products",
      "description": "Search the Madely catalog. Returns products with whole-dollar prices (price_usd), blank cost, flat fee, photo URL, a print_spec summary and template_urls (use get_print_spec for the full spec). Use product_id in get_quote and create_order. Read-only, no API key. Use when: You need a product_id, a price or a category (mugs, tees, hoodies, totes). Example arguments: {\"q\":\"mug\",\"max_price_usd\":10}. Next: get_print_spec, then get_quote.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string",
            "description": "Words to search, e.g. \"mug\" or \"hoodie\".",
            "examples": [
              "mug",
              "black hoodie"
            ]
          },
          "category": {
            "type": "string",
            "examples": [
              "Drinkware"
            ],
            "description": "category (see the Madely OpenAPI schema)."
          },
          "print_method": {
            "type": "string",
            "description": "DTF, Sublimation, Laser/UV, Inkjet, Mixed",
            "examples": [
              "DTF",
              "Sublimation"
            ]
          },
          "max_price_usd": {
            "type": "number",
            "examples": [
              10
            ],
            "description": "max price usd (see the Madely OpenAPI schema)."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200,
            "default": 50,
            "description": "limit (see the Madely OpenAPI schema)."
          },
          "expand": {
            "type": "string",
            "enum": [
              "print_spec"
            ],
            "description": "Return the full print spec on every product (large)."
          }
        }
      }
    },
    {
      "name": "get_quote",
      "title": "Get quote",
      "description": "Get an exact, deterministic quote: itemized whole-dollar product prices, carrier-cost shipping, total, estimated ship date, and the volume tier applied. The same input returns the same quote_id. Valid 24 hours. Read-only, no API key. Use when: You know the products and a US ship-to and need an exact total. Quotes are deterministic and valid for 24 hours. Example arguments: {\"items\":[{\"product_id\":\"K04\",\"quantity\":24}],\"ship_to\":{\"country\":\"US\",\"zip\":\"80202\"}}. Next: create_order with the returned quote_id.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "items",
          "ship_to"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "product_id",
                "quantity"
              ],
              "properties": {
                "product_id": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                }
              }
            },
            "description": "items (see the Madely OpenAPI schema)."
          },
          "ship_to": {
            "type": "object",
            "required": [
              "country",
              "zip"
            ],
            "properties": {
              "country": {
                "type": "string",
                "enum": [
                  "US"
                ]
              },
              "zip": {
                "type": "string"
              }
            },
            "description": "ship to (see the Madely OpenAPI schema)."
          },
          "committed_monthly_items": {
            "type": "integer",
            "minimum": 0,
            "description": "Optional. Items per month you commit to; selects a published volume tier.",
            "examples": [
              0
            ]
          }
        }
      }
    },
    {
      "name": "create_order",
      "title": "Create order",
      "description": "Create a TEST order from a quote. Needs quote_id, your own external_id starting with \"madely-smoketest-\", artwork for each item, and an idempotency_key so retries never duplicate. Set submit=true to pay and start production, otherwise a draft is created (pay later with submit_order). payment is {method:\"agent_token\",shared_payment_token:\"spt_...\"} or {method:\"card_on_file\"} or {method:\"balance\"}; omit it to use the balance if it covers the order, else the card on file. Print files are checked and failures return exact fixes. TEST orders only: no live charges in v0. Use when: You have a quote_id, artwork URLs and want a TEST order. Retrying with the same idempotency_key never creates a second order. Example arguments: {\"quote_id\":\"q_...\",\"external_id\":\"madely-smoketest-001\",\"idempotency_key\":\"order-001\",\"items\":[{\"product_id\":\"K04\",\"quantity\":24,\"artwork\":[{\"url\":\"https://example.com/art/mug.png\"}]}],\"ship_to\":{\"name\":\"Test Buyer\",\"address1\":\"1 Test St\",\"city\":\"Denver\",\"state\":\"CO\",\"zip\":\"80202\",\"country\":\"US\"},\"submit\":false}. Next: submit_order (if submit was false), then get_order.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "quote_id",
          "external_id",
          "idempotency_key",
          "items",
          "ship_to"
        ],
        "properties": {
          "quote_id": {
            "type": "string",
            "description": "quote id (see the Madely OpenAPI schema)."
          },
          "external_id": {
            "type": "string",
            "examples": [
              "madely-smoketest-001"
            ],
            "description": "external id (see the Madely OpenAPI schema)."
          },
          "idempotency_key": {
            "type": "string",
            "examples": [
              "order-001"
            ],
            "description": "idempotency key (see the Madely OpenAPI schema)."
          },
          "submit": {
            "type": "boolean",
            "default": false,
            "examples": [
              false
            ],
            "description": "submit (see the Madely OpenAPI schema)."
          },
          "max_cost_usd": {
            "type": "number",
            "description": "Refuse the order and the charge if the total is above this."
          },
          "payment": {
            "type": "object",
            "description": "How to pay. Charged when the order is submitted.",
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "agent_token",
                  "card_on_file",
                  "balance",
                  "auto"
                ],
                "default": "auto"
              },
              "shared_payment_token": {
                "type": "string",
                "description": "Stripe Shared Payment Token (spt_...) granted to Madely's Stripe profile. Needed for agent_token."
              },
              "payment_method_id": {
                "type": "string",
                "description": "Optional saved card to use for card_on_file; defaults to the default card."
              }
            }
          },
          "ship_to": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "address1": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "state": {
                "type": "string"
              },
              "zip": {
                "type": "string"
              },
              "country": {
                "type": "string"
              }
            },
            "description": "ship to (see the Madely OpenAPI schema)."
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "product_id",
                "quantity",
                "artwork"
              ],
              "properties": {
                "product_id": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "artwork": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "url"
                    ],
                    "properties": {
                      "placement": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      },
                      "width_px": {
                        "type": "integer"
                      },
                      "height_px": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            },
            "description": "items (see the Madely OpenAPI schema)."
          }
        }
      }
    },
    {
      "name": "get_order",
      "title": "Get order",
      "description": "Get an order: status (draft, in_production, shipped, delivered), tracking, events and totals. Uses the same sandbox key as create_order. Use when: You need status (draft, in_production, shipped, delivered), tracking or the event log for an order you created. Example arguments: {\"order_id\":\"ord_...\"}. Next: cancel_order if it has not shipped.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "order_id"
        ],
        "properties": {
          "order_id": {
            "type": "string",
            "examples": [
              "ord_123"
            ],
            "description": "order id (see the Madely OpenAPI schema)."
          }
        }
      }
    },
    {
      "name": "check_print_file",
      "title": "Check print file",
      "description": "Alias of validate_print_file (kept for older agents). Check one artwork file for a product before ordering: URL, file type, placement, and the resolution you declare against the print area. Returns pass/warn/fail with a fix for each check. Use when: Only if an older agent already calls it. New agents should call validate_print_file (same behavior). Example arguments: {\"product_id\":\"K04\",\"width_px\":2550,\"height_px\":1155,\"format\":\"png\"}. Next: get_quote.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "product_id",
          "url"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "description": "product_id or sku.",
            "examples": [
              "K04"
            ]
          },
          "url": {
            "type": "string",
            "description": "Public https URL of the artwork file (optional; it is checked, not downloaded).",
            "examples": [
              "https://example.com/art/mug.png"
            ]
          },
          "placement": {
            "type": "string",
            "description": "A print_zones[].name from the print spec. Defaults to the first zone.",
            "examples": [
              "wrap"
            ]
          },
          "width_px": {
            "type": "integer",
            "examples": [
              2550
            ],
            "description": "width px (see the Madely OpenAPI schema)."
          },
          "height_px": {
            "type": "integer",
            "examples": [
              1155
            ],
            "description": "height px (see the Madely OpenAPI schema)."
          },
          "format": {
            "type": "string",
            "description": "png, jpg, pdf or svg (or a mime type).",
            "examples": [
              "png"
            ]
          },
          "file_size_mb": {
            "type": "number",
            "description": "file size mb (see the Madely OpenAPI schema)."
          },
          "has_transparency": {
            "type": "boolean",
            "description": "has transparency (see the Madely OpenAPI schema)."
          },
          "color_mode": {
            "type": "string",
            "description": "e.g. sRGB or CMYK."
          },
          "content_bbox_px": {
            "type": "object",
            "description": "Bounding box of your text and key art in canvas pixels {x,y,width,height}; checked against the safe zone."
          },
          "fit": {
            "type": "string",
            "enum": [
              "cover",
              "contain",
              "stretch"
            ],
            "description": "fit (see the Madely OpenAPI schema)."
          },
          "preview": {
            "type": "boolean",
            "description": "Also return preview_url, an SVG that shows the file placed on the template."
          }
        }
      }
    },
    {
      "name": "submit_order",
      "title": "Submit order",
      "description": "Pay for and start production on a draft order. Charged now (before production). Same payment argument as create_order. Safe to retry: a paid order is never charged twice. Use when: An order is in draft and you are ready to pay and start production. Safe to retry: a paid order is never charged twice. Example arguments: {\"order_id\":\"ord_...\",\"payment\":{\"method\":\"balance\"}}. Next: get_order.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "order_id"
        ],
        "properties": {
          "order_id": {
            "type": "string",
            "examples": [
              "ord_123"
            ],
            "description": "order id (see the Madely OpenAPI schema)."
          },
          "payment": {
            "type": "object",
            "description": "How to pay. Charged when the order is submitted.",
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "agent_token",
                  "card_on_file",
                  "balance",
                  "auto"
                ],
                "default": "auto"
              },
              "shared_payment_token": {
                "type": "string",
                "description": "Stripe Shared Payment Token (spt_...) granted to Madely's Stripe profile. Needed for agent_token."
              },
              "payment_method_id": {
                "type": "string",
                "description": "Optional saved card to use for card_on_file; defaults to the default card."
              }
            }
          },
          "max_cost_usd": {
            "type": "number",
            "examples": [
              200
            ],
            "description": "max cost usd (see the Madely OpenAPI schema)."
          }
        }
      }
    },
    {
      "name": "cancel_order",
      "title": "Cancel order",
      "description": "Cancel a draft or in_production order and refund it in full to the original payment method (balance orders credit the balance). Shipped orders cannot be canceled. Safe to repeat: never refunds twice. Use when: An order has not shipped and you want it stopped and refunded. Safe to repeat; it never refunds twice. Example arguments: {\"order_id\":\"ord_...\"}. Next: get_balance to see a balance refund.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "order_id"
        ],
        "properties": {
          "order_id": {
            "type": "string",
            "examples": [
              "ord_123"
            ],
            "description": "order id (see the Madely OpenAPI schema)."
          }
        }
      }
    },
    {
      "name": "get_payment_options",
      "title": "Get payment options",
      "description": "How an agent can pay Madely: agent payment tokens (Stripe Shared Payment Tokens), card on file, prepaid balance. Includes the Stripe profile id to grant tokens to. Read-only. Use when: You need to know how an agent can pay (Shared Payment Token, card on file, prepaid balance) and where to send it. Example arguments: {}. Next: create_sandbox_payment_token (sandbox) or add_payment_method.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "add_payment_method",
      "title": "Add payment method",
      "description": "Save a card on file (a Stripe Customer plus PaymentMethod) so orders can be charged off-session with payment {method:\"card_on_file\"}. Sandbox example: payment_method_id \"pm_card_visa\". Use when: You want orders charged to a saved card. Sandbox only: use the test card id pm_card_visa. Example arguments: {\"payment_method_id\":\"pm_card_visa\",\"make_default\":true}. Next: submit_order with {\"method\":\"card_on_file\"}.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "payment_method_id"
        ],
        "properties": {
          "payment_method_id": {
            "type": "string",
            "description": "Stripe PaymentMethod id (pm_...).",
            "examples": [
              "pm_card_visa"
            ]
          },
          "make_default": {
            "type": "boolean",
            "default": true,
            "description": "make default (see the Madely OpenAPI schema)."
          }
        }
      }
    },
    {
      "name": "get_balance",
      "title": "Get balance",
      "description": "Prepaid balance in USD plus the last 20 ledger entries (top-ups, order debits, refunds). Use before ordering to avoid an insufficient_balance error. Use when: Before submitting an order, to avoid an insufficient_balance error, or after a cancel to confirm a refund. Example arguments: {}. Next: top_up_balance if short.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "top_up_balance",
      "title": "Top up balance",
      "description": "Add a whole-dollar amount (10 to 5000) to the prepaid balance, paid by card on file or an agent payment token. Needs an idempotency_key so a retry never charges twice. Use when: get_balance is lower than the order total. Whole dollars from 10 to 5000. Test mode: no real money moves. Example arguments: {\"amount_usd\":100,\"idempotency_key\":\"topup-001\"}. Next: submit_order with {\"method\":\"balance\"}.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "amount_usd",
          "idempotency_key"
        ],
        "properties": {
          "amount_usd": {
            "type": "integer",
            "minimum": 10,
            "maximum": 5000,
            "examples": [
              100
            ],
            "description": "amount usd (see the Madely OpenAPI schema)."
          },
          "payment": {
            "type": "object",
            "description": "How to pay. Charged when the order is submitted.",
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "agent_token",
                  "card_on_file",
                  "balance",
                  "auto"
                ],
                "default": "auto"
              },
              "shared_payment_token": {
                "type": "string",
                "description": "Stripe Shared Payment Token (spt_...) granted to Madely's Stripe profile. Needed for agent_token."
              },
              "payment_method_id": {
                "type": "string",
                "description": "Optional saved card to use for card_on_file; defaults to the default card."
              }
            }
          },
          "idempotency_key": {
            "type": "string",
            "examples": [
              "topup-001"
            ],
            "description": "idempotency key (see the Madely OpenAPI schema)."
          }
        }
      }
    },
    {
      "name": "create_sandbox_payment_token",
      "title": "Create sandbox payment token",
      "description": "SANDBOX ONLY. Mint a test Shared Payment Token so you can try the agent_token payment method. In production your own wallet grants the token to Madely's Stripe profile. Use when: You are testing the agent_token payment method. In production your own wallet grants the token to Madely. Example arguments: {\"max_amount_cents\":20000}. Next: submit_order with {\"method\":\"agent_token\",\"shared_payment_token\":\"spt_...\"}.",
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "required": [
          "max_amount_cents"
        ],
        "properties": {
          "max_amount_cents": {
            "type": "integer",
            "description": "At least the order total in cents.",
            "examples": [
              20000
            ]
          },
          "payment_method": {
            "type": "string",
            "default": "pm_card_visa",
            "description": "payment method (see the Madely OpenAPI schema)."
          },
          "expires_in_seconds": {
            "type": "integer",
            "default": 3600,
            "description": "expires in seconds (see the Madely OpenAPI schema)."
          }
        }
      }
    },
    {
      "name": "get_pricing_tiers",
      "title": "Get pricing tiers",
      "description": "Published volume tiers, the same for every merchant. There is no private negotiation. Status is draft until approved. Use when: You want the published volume tiers (draft, same for every merchant). Example arguments: {}. Next: get_quote with committed_monthly_items.",
      "annotations": {
        "readOnlyHint": true,
        "openWorldHint": false
      },
      "inputSchema": {
        "type": "object",
        "properties": {}
      }
    }
  ],
  "tool_count": 16,
  "openapi": "https://api.madely.ai/openapi.json",
  "api_catalog": "https://api.madely.ai/.well-known/api-catalog",
  "client_setup": "https://api.madely.ai/connect/clients",
  "quickstart": "https://api.madely.ai/quickstart",
  "llms_txt": "https://api.madely.ai/llms.txt",
  "registry_status": "not submitted (needs owner approval)",
  "payments": {
    "provider": "stripe",
    "stripe_profile_id": "profile_test_61VrkB0XwlLf0T0sIA6VrkB079SQUMsvBMOZN85NAT2u",
    "details": "https://api.madely.ai/v1/payments"
  }
}