JWT解析
JWTトークンをデコードしてヘッダー・ペイロード・有効期限を返します。署名検証は行いません。デバッグ用途での中身確認・有効期限チェックに使えます。
MCPツール名: security.decode_jwt
GET /v1/jwt/decode
JWTはBase64URLでエンコードされ、`.`(ドット)で区切られた3パートです。クエリパラメータとしてそのまま渡せますが、トークンに `+` や `=` が含まれる場合はURLエンコードしてください。
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| token | string | ✓ | デコードするJWTトークン |
リクエスト例:
curl "https://api.thousand-api.com/v1/jwt/decode?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMTIzIiwiZXhwIjoxNzE2MDAwMDAwfQ.signature" \
-H "x-api-key: YOUR_API_KEY"レスポンス例:
{
"header": { "alg": "HS256", "typ": "JWT" },
"payload": { "sub": "user123", "exp": 1716000000 },
"is_expired": false,
"expires_at": "2024-05-18T00:00:00.000Z",
"issued_at": null
}URLヘルスチェック
URLのステータスコード・レスポンスタイム・SSL証明書情報を確認します。network.resolve_urlと組み合わせることで短縮URLの最終リダイレクト先のヘルスも確認できます。
MCPツール名: network.inspect_url
GET /v1/url/inspect
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| url | string | ✓ | 検査するURL(http/httpsのみ) |
リクエスト例:
curl "https://api.thousand-api.com/v1/url/inspect?url=https%3A%2F%2Fwww.thousand-api.com" \
-H "x-api-key: YOUR_API_KEY"レスポンス例:
{
"url": "https://www.thousand-api.com",
"status_code": 200,
"response_time_ms": 234,
"reachable": true,
"headers": {
"content-type": "text/html",
"x-frame-options": "DENY"
},
"ssl": {
"valid": true,
"expires_at": "2027-01-01T00:00:00.000Z",
"days_remaining": 220,
"issuer": "Amazon"
}
}単位変換
長さ・重さ・温度・面積・体積・速度・データ量の単位変換を行います。外部APIへの依存なし・mathjsによる正確な計算。
MCPツール名: convert.unit
対応カテゴリ: 長さ(m, km, mile, foot, inch 等)、重さ(kg, g, lb, oz 等)、温度(celsius, fahrenheit, kelvin)、面積(m2, ha, acre, sqft 等)、体積(l, ml, gallon, cup 等)、速度(m/s, km/h, mph, knot 等)、データ量(byte, KB, MB, GB, TB, KiB, MiB 等)
GET /v1/unit/convert
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| value | number | ✓ | 変換する数値 |
| from | string | ✓ | 変換元単位 |
| to | string | ✓ | 変換先単位 |
リクエスト例:
curl "https://api.thousand-api.com/v1/unit/convert?value=1&from=km&to=mile" \
-H "x-api-key: YOUR_API_KEY"レスポンス例:
{
"value": 1,
"from": "km",
"to": "mile",
"result": 0.621371,
"formula": "1 km = 0.621371 mile"
}ハッシュ生成
テキストからMD5・SHA-1・SHA-256・SHA-512のハッシュ値を生成します。Node.js標準のcryptoモジュールを使用・外部依存なし。
MCPツール名: security.generate_hash
textパラメータにスペースや特殊文字が含まれる場合はURLエンコードが必要です(例: hello world → hello+world または hello%20world)。
GET /v1/hash/generate
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| text | string | ✓ | ハッシュ化するテキスト(最大100KB) |
| algorithm | string | - | md5 / sha1 / sha256 / sha512(デフォルト: sha256) |
リクエスト例:
curl "https://api.thousand-api.com/v1/hash/generate?text=hello+world&algorithm=sha256" \
-H "x-api-key: YOUR_API_KEY"レスポンス例:
{
"text": "hello world",
"algorithm": "sha256",
"hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
"length": 64
}HMAC署名生成・検証
HMAC署名の生成・検証を行います。SHA-256・SHA-512・SHA-1・MD5に対応。Node.js標準のcryptoモジュールを使用・外部依存なし。GitHub・Stripe・SlackなどのWebhook署名検証に利用できます。
MCPツール名: security.generate_hmac
POST /v1/crypto/hmac
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| mode | string | ✓ | sign(署名生成)/ verify(署名検証) |
| algorithm | string | ✓ | sha256 / sha512 / sha1 / md5 |
| secret | string | ✓ | 署名シークレットキー(最大64KB) |
| message | string | ✓ | 署名対象のメッセージ(最大64KB) |
| encoding | string | - | hex / base64(デフォルト: hex) |
| signature | string | - | 検証対象の署名文字列(mode: verify 時必須) |
mode: sign のレスポンスフィールド:
| パラメータ | 型 | 説明 |
|---|---|---|
| mode | string | sign |
| algorithm | string | 使用したHMACアルゴリズム |
| encoding | string | 出力エンコーディング(hex / base64) |
| signature | string | 生成されたHMAC署名 |
mode: verify のレスポンスフィールド:
| パラメータ | 型 | 説明 |
|---|---|---|
| mode | string | verify |
| algorithm | string | 使用したHMACアルゴリズム |
| encoding | string | 出力エンコーディング(hex / base64) |
| verified | boolean | 署名が一致したか(timing-safe compare) |
署名生成例(GitHub Webhooks風):
リクエスト例:
curl -X POST "https://api.thousand-api.com/v1/crypto/hmac" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "sign",
"algorithm": "sha256",
"secret": "your-webhook-secret",
"message": "{\"action\":\"opened\",\"number\":1}"
}'レスポンス例:
{
"mode": "sign",
"algorithm": "sha256",
"encoding": "hex",
"signature": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
}署名検証例(受信Webhookの検証):
リクエスト例:
curl -X POST "https://api.thousand-api.com/v1/crypto/hmac" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "verify",
"algorithm": "sha256",
"secret": "your-webhook-secret",
"message": "{\"action\":\"opened\",\"number\":1}",
"signature": "sha256=abc123..."
}'レスポンス例:
{
"mode": "verify",
"algorithm": "sha256",
"encoding": "hex",
"verified": true
}base64エンコード出力の例:
リクエスト例:
curl -X POST "https://api.thousand-api.com/v1/crypto/hmac" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "sign",
"algorithm": "sha256",
"secret": "my-secret",
"message": "hello world",
"encoding": "base64"
}'レスポンス例:
{
"mode": "sign",
"algorithm": "sha256",
"encoding": "base64",
"signature": "K8D9a2..."
}TOTP生成・検証
RFC 6238 準拠の TOTP(時間基準ワンタイムパスコード)を生成・検証します。HMAC-SHA1 とタイムステップ計算を決定論的に実行します。Google Authenticator 等の一般的な認証アプリと互換です。任意の timestamp(UNIX 秒)で評価時刻を固定できます(RFC 6238 テストベクトル用)。QR コード / otpauth:// URI の生成はスコープ外です(必要な場合は convert.get_qrcode と組み合わせてください)。
MCPツール名: security.generate_totp
POST /v1/security/totp
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| action | string | ✓ | generate(コード生成)/ validate(コード検証) |
| secret | string | ✓ | Base32 エンコードされた共有シークレット(A-Z2-7。小文字・スペース・パディング可) |
| code | string | - | 検証対象コード(action: validate 時必須。桁数は digits と一致) |
| period | integer | - | タイムステップ秒数(デフォルト: 30) |
| digits | integer | - | コード桁数 6〜8(デフォルト: 6) |
| window | integer | - | 許容するタイムステップのずれ(前後)。validate 時のみ。デフォルト 1・上限 10 |
| timestamp | number | - | 評価に使う UNIX 秒(任意)。省略時は現在時刻。RFC 6238 テストベクトルや決定論的リプレイ用 |
action: generate のレスポンスフィールド:
| パラメータ | 型 | 説明 |
|---|---|---|
| action | string | generate |
| code | string | 生成された TOTP コード(ゼロパディング済み) |
| expires_in | integer | 現在のタイムステップの残り秒数 |
action: validate のレスポンスフィールド:
| パラメータ | 型 | 説明 |
|---|---|---|
| action | string | validate |
| valid | boolean | コードが許容ウィンドウ内で一致したか |
| matched_window | integer | null | 一致したオフセット(-window〜+window)。不一致なら null |
コード生成例:
リクエスト例:
curl -X POST "https://api.thousand-api.com/v1/security/totp" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "generate",
"secret": "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ"
}'レスポンス例:
{
"action": "generate",
"code": "483920",
"expires_in": 18
}コード検証例:
リクエスト例:
curl -X POST "https://api.thousand-api.com/v1/security/totp" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "validate",
"secret": "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
"code": "483920",
"window": 1
}'レスポンス例:
{
"action": "validate",
"valid": true,
"matched_window": 0
}UUID生成・検証
暗号学的に安全な UUID v4 の生成と、UUID 文字列の形式検証(v1〜v5)を行います。Node.js 標準の crypto.randomUUID() のみ使用・外部依存なし。
MCPツール名: security.generate_uuid, security.validate_uuid
GET /v1/uuid/generate
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| count | integer | - | 生成数(1〜100・デフォルト: 1) |
| version | string | - | UUIDバージョン(v4 のみ・デフォルト: v4) |
レスポンスフィールド:
| パラメータ | 型 | 説明 |
|---|---|---|
| version | string | 生成した UUID のバージョン(v4) |
| count | integer | 生成件数 |
| uuids | string[] | 生成された UUID の配列 |
複数生成の例(count: 3):
リクエスト例:
curl "https://api.thousand-api.com/v1/uuid/generate?count=3&version=v4" \
-H "x-api-key: YOUR_API_KEY"レスポンス例:
{
"version": "v4",
"count": 3,
"uuids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"6ecc5f60-7e11-4f4a-9b2c-1a2b3c4d5e6f",
"a1b2c3d4-e5f6-4789-ab01-234567890abc"
]
}POST /v1/uuid/validate
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| values | string[] | ✓ | 検証対象の文字列一覧(1〜100件) |
レスポンスフィールド:
| パラメータ | 型 | 説明 |
|---|---|---|
| results | object[] | 各入力値の検証結果 |
| results[].value | string | 入力値(そのまま返却) |
| results[].valid | boolean | UUID形式として有効か |
| results[].version | integer | null | 有効時はバージョン(1〜5) |
| results[].variant | string | null | 有効時は RFC 4122 等 |
| all_valid | boolean | 全件が valid: true か |
有効・無効が混在する検証例:
リクエスト例:
curl -X POST "https://api.thousand-api.com/v1/uuid/validate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": [
"550e8400-e29b-41d4-a716-446655440000",
"not-a-uuid",
"12345"
]
}'レスポンス例:
{
"results": [
{
"value": "550e8400-e29b-41d4-a716-446655440000",
"valid": true,
"version": 4,
"variant": "RFC 4122"
},
{
"value": "not-a-uuid",
"valid": false,
"version": null,
"variant": null
},
{
"value": "12345",
"valid": false,
"version": null,
"variant": null
}
],
"all_valid": false
}MCPツールの使用例(generate → validate):
1. security.generate_uuid で ID を生成:
{ "count": 2 }
2. 返却された uuids を security.validate_uuid で検証:
{ "values": ["<uuid-1>", "<uuid-2>"] }
→ all_valid: true なら RFC 4122 形式として利用可能です。バーコード検証・変換
ISBN-10 / ISBN-13 / JAN-13(EAN-13)/ UPC-A のバーコードを検証し、ISBN-10 と ISBN-13 の相互変換を行います。チェックデジット計算は標準アルゴリズム(ISBN-10: 加重和 mod 11、EAN-13: 1/3 交互加重 mod 10)を使用。外部依存なし。
MCPツール名: security.validate_barcode
対応バーコード種別
| パラメータ | 説明 |
|---|---|
| ISBN-10 | 10桁の書籍コード。チェックデジットは 0〜9 または X(=10) |
| ISBN-13 | 13桁の書籍コード。先頭が 978 または 979 の EAN-13 |
| JAN-13 | 13桁の日本の商品コード(EAN-13)。先頭が 978/979 以外 |
| UPC-A | 12桁の北米商品コード(先頭に 0 を付けて EAN-13 として検証) |
GET /v1/validate/barcode
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| code | string | ✓ | 検証対象のコード(ハイフンあり/なし両対応・最大100文字) |
| type | string | - | バーコード種別(省略時: 自動判定)。ISBN-10 / ISBN-13 / JAN-13 / EAN-13 / UPC-A |
レスポンスフィールド:
| パラメータ | 型 | 説明 |
|---|---|---|
| input | string | 入力値(そのまま返却) |
| type | string | 判定されたバーコード種別(ISBN-10 / ISBN-13 / JAN-13 / UPC-A) |
| valid | boolean | チェックデジットが正しいか |
| check_digit | string | 期待されるチェックデジット文字 |
| normalized | string | ハイフン除去・大文字正規化済みコード |
| conversions | object | null | ISBN 向けの変換結果(ISBN 以外は null) |
| conversions.isbn10 | string | null | ISBN-13→ISBN-10 変換結果(978 のみ。979 は null) |
| conversions.isbn13 | string | null | ISBN-10→ISBN-13 変換結果 |
ISBN-13 検証の例:
リクエスト例:
curl "https://api.thousand-api.com/v1/validate/barcode?code=978-4-06-519981-7" \
-H "x-api-key: YOUR_API_KEY"レスポンス例:
{
"input": "978-4-06-519981-7",
"type": "ISBN-13",
"valid": true,
"check_digit": "7",
"normalized": "9784065199817",
"conversions": {
"isbn10": "4-06-519981-6",
"isbn13": "978-4-06-519981-7"
}
}ISBN-10 検証の例(チェックデジット X):
リクエスト例:
curl "https://api.thousand-api.com/v1/validate/barcode?code=0-8044-2957-X" \
-H "x-api-key: YOUR_API_KEY"レスポンス例:
{
"input": "0-8044-2957-X",
"type": "ISBN-10",
"valid": true,
"check_digit": "X",
"normalized": "080442957X",
"conversions": {
"isbn10": "0-8044-2957-X",
"isbn13": "978-0-80-442957-6"
}
}type 省略時の自動判定の例:
リクエスト例:
curl "https://api.thousand-api.com/v1/validate/barcode?code=4901234567894" \
-H "x-api-key: YOUR_API_KEY"レスポンス例:
{
"input": "4901234567894",
"type": "JAN-13",
"valid": true,
"check_digit": "4",
"normalized": "4901234567894",
"conversions": null
}Luhnチェックディジット検証
Luhn アルゴリズム(mod 10)でチェックディジットを検証します。クレジットカード番号・IMEI 番号などに使用。外部依存なし。
MCPツール名: security.validate_luhn
format ヒント(桁数ルール)
| パラメータ | 説明 |
|---|---|
| credit_card | 13〜19桁(一般的なクレジットカード番号) |
| imei | 15桁固定(IMEI 番号) |
| generic | 1〜99桁(桁数チェックなし) |
POST /v1/validate/luhn
パラメータ:
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| value | string | ✓ | 検証対象の数字列(ハイフン・スペースあり/なし両対応・最大200文字) |
| format | string | - | 形式ヒント(省略時: generic)。credit_card / imei / generic |
レスポンスフィールド:
| パラメータ | 型 | 説明 |
|---|---|---|
| value | string | 入力値(そのまま返却) |
| normalized | string | ハイフン・スペース除去済み数字列 |
| valid | boolean | Luhn チェックディジットが正しいか |
| check_digit | string | 実際の末尾チェックディジット |
| expected_check_digit | string | valid: false のときのみ。期待されるチェックディジット |
| format | string | リクエストの format(デフォルト: generic) |
| length | number | normalized の桁数 |
| format_valid | boolean | format ヒントの桁数ルールに適合するか(Luhn 有効性とは独立) |
有効なクレジットカード番号の例:
リクエスト例:
curl -X POST "https://api.thousand-api.com/v1/validate/luhn" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "4532015112830366",
"format": "credit_card"
}'レスポンス例:
{
"value": "4532015112830366",
"normalized": "4532015112830366",
"valid": true,
"check_digit": "6",
"format": "credit_card",
"length": 16,
"format_valid": true
}無効な番号の例(expected_check_digit が返る):
リクエスト例:
curl -X POST "https://api.thousand-api.com/v1/validate/luhn" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "4532015112830367"
}'レスポンス例:
{
"value": "4532015112830367",
"normalized": "4532015112830367",
"valid": false,
"check_digit": "7",
"expected_check_digit": "6",
"format": "generic",
"length": 16,
"format_valid": true
}