{
 "openapi": "3.0.3",
 "info": {
  "title": "Shortcut Tools API",
  "description": "Free JSON API for 4,400+ keyboard shortcuts across 271 platforms. No API key required. Attribution appreciated: link to shortcut-tools.com.",
  "version": "1.0.0",
  "contact": {
   "url": "https://shortcut-tools.com/en/contact"
  }
 },
 "servers": [
  {
   "url": "https://shortcut-tools.com"
  }
 ],
 "paths": {
  "/api/v1/platforms.json": {
   "get": {
    "summary": "List all platforms",
    "operationId": "listPlatforms",
    "responses": {
     "200": {
      "description": "All platforms with key, name, group and page URL",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "count": {
           "type": "integer"
          },
          "platforms": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Platform"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/shortcuts/{key}.json": {
   "get": {
    "summary": "Get all shortcuts for one platform",
    "operationId": "getPlatformShortcuts",
    "parameters": [
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "vscode",
      "description": "Platform key, e.g. vscode, tmux, figma"
     }
    ],
    "responses": {
     "200": {
      "description": "Platform with categories and shortcuts",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PlatformShortcuts"
        }
       }
      }
     },
     "404": {
      "description": "Unknown platform key"
     }
    }
   }
  },
  "/api/v1/all.json": {
   "get": {
    "summary": "Entire dataset in one file",
    "operationId": "getAll",
    "responses": {
     "200": {
      "description": "All platforms with full shortcut data (large; cache this)"
     }
    }
   }
  },
  "/api/v1/search": {
   "get": {
    "summary": "Scored full-text search across all shortcuts",
    "operationId": "searchShortcuts",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "duplicate line"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 10
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Ranked matches",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "query": {
           "type": "string"
          },
          "count": {
           "type": "integer"
          },
          "results": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/SearchResult"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/mcp": {
   "post": {
    "summary": "Stateless MCP server (JSON-RPC 2.0) for AI agents",
    "operationId": "mcp",
    "description": "Model Context Protocol endpoint. Tools: list_platforms, get_platform_shortcuts, search_shortcuts.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "jsonrpc": "2.0",
        "id": 1,
        "method": "tools/call",
        "params": {
         "name": "search_shortcuts",
         "arguments": {
          "query": "vertical split"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "JSON-RPC 2.0 response"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Platform": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "group": {
      "type": "string"
     },
     "web": {
      "type": "string",
      "format": "uri"
     }
    }
   },
   "Shortcut": {
    "type": "object",
    "properties": {
     "keys": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "usage": {
      "type": "string"
     }
    }
   },
   "Category": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "shortcuts": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Shortcut"
      }
     }
    }
   },
   "PlatformShortcuts": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "group": {
      "type": "string"
     },
     "web": {
      "type": "string"
     },
     "source": {
      "type": "string"
     },
     "generated": {
      "type": "string"
     },
     "shortcutCount": {
      "type": "integer"
     },
     "categories": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Category"
      }
     }
    }
   },
   "SearchResult": {
    "type": "object",
    "properties": {
     "platform": {
      "type": "string"
     },
     "platformName": {
      "type": "string"
     },
     "category": {
      "type": "string"
     },
     "keys": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "usage": {
      "type": "string"
     }
    }
   }
  }
 }
}