Magic Judge

Magic Judge · GPT 작업

MTG Card Search and Fetch GPT

This interacts with the Scryfall API to search and fetch Magic: The Gathering cards based on user-provided criteria.

  • GET /cards/searchSearch for MTG Cards

    Retrieves Magic: The Gathering cards based on search criteria.

  • GET /cards/namedFetch a card by name. If ti has a rulings_uri, also fetch the rules under that URI
원본 API 스키마
{
  "openapi": "3.1.0",
  "info": {
    "title": "MTG Card Search and Fetch GPT",
    "description": "This interacts with the Scryfall API to search and fetch Magic: The Gathering cards based on user-provided criteria.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://api.scryfall.com"
    }
  ],
  "paths": {
    "/cards/search": {
      "get": {
        "summary": "Search for MTG Cards",
        "operationId": "searchForCards",
        "description": "Retrieves Magic: The Gathering cards based on search criteria.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "The search query to find specific MTG cards.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "unique",
            "in": "query",
            "description": "Controls if the search returns unique cards or all versions.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "The method to sort cards in the result.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dir",
            "in": "query",
            "description": "The direction of sorting, asc or desc.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_extras",
            "in": "query",
            "description": "Includes extra cards like tokens and planes in the result.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response containing the search results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "set": {
                            "type": "string"
                          },
                          "type_line": {
                            "type": "string"
                          },
                          "oracle_text": {
                            "type": "string"
                          },
                          "mana_cost": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "total_cards": {
                      "type": "integer"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cards/named": {
      "get": {
        "summary": "Fetch a card by name. If ti has a rulings_uri, also fetch the rules under that URI",
        "operationId": "fetchCardByName",
        "parameters": [
          {
            "name": "exact",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The exact name of the card."
          },
          {
            "name": "fuzzy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A fuzzy name of the card."
          }
        ],
        "responses": {
          "200": {
            "description": "A Magic: The Gathering card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MtgCard"
                }
              }
            }
          },
          "404": {
            "description": "Card not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MtgCard": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "mana_cost": {
            "type": "string"
          },
          "type_line": {
            "type": "string"
          },
          "oracle_text": {
            "type": "string"
          },
          "rulings_uri": {
            "type": "string"
          },
          "image_uris": {
            "type": "object",
            "properties": {
              "small": {
                "type": "string"
              },
              "normal": {
                "type": "string"
              },
              "large": {
                "type": "string"
              },
              "png": {
                "type": "string"
              },
              "art_crop": {
                "type": "string"
              },
              "border_crop": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}