TestingAPIs API tools
Validate OpenAPI and JSON Schema, convert specs, curl to code, JSONPath, and free test data.
使うべきか
品質と安全性
検出事項(4)
- HIGH
- MEDIUMget_test_data 内
- LOWcurl_to_code 内
- INFOget_test_data 内
ツール定義とプロトコルへの準拠に関する自動分析に基づいています。
コンテキストコスト
これは、サーバーのツールがモデルのコンテキストに読み込まれるたびに消費されるおおよそのトークン数です。数が多いほど、ほかのタスクに使える注意が減ります。
インストール
ワンクリックインストール
これを `claude_desktop_config.json` ファイルに追加してください:
{
"mcpServers": {
"api-tools": {
"url": "https://testingapis.com/mcp"
}
}
}リモートエンドポイント
https://testingapis.com/mcpstreamable-httpできること
ツール一覧
ツール(10)
🟢validate_openapi(spec)
Check an OpenAPI 3.0/3.1 or Swagger 2.0 document (JSON or YAML) for the mistakes that break tools: missing required fields, undeclared path parameters, invalid status codes, duplicate operationIds, broken $refs, undefined security schemes and examples that don't match their schema. Returns each problem with a JSON pointer and, for JSON, a line number.
入力スキーマ
{
"type": "object",
"properties": {
"spec": {
"type": "string",
"maxLength": 1000000,
"description": "The whole OpenAPI or Swagger document, as JSON or YAML text."
}
},
"required": [
"spec"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢validate_json_schema(schema, data)
Check a JSON document against a JSON Schema (drafts 4 to 2020-12, with $ref, allOf/anyOf/oneOf, if/then/else and formats). Returns every error with the JSONPath of the value and the keyword that failed.
入力スキーマ
{
"type": "object",
"properties": {
"schema": {
"type": "string",
"maxLength": 1000000,
"description": "The JSON Schema, as JSON text."
},
"data": {
"type": "string",
"maxLength": 1000000,
"description": "The JSON document to check, as JSON text."
}
},
"required": [
"schema",
"data"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢generate_json_schema(json, strict)
Create a JSON Schema (draft 2020-12) from a JSON sample. Every item in an array is read, so required, optional and nullable properties are worked out, and strings that are all dates, emails, URLs or UUIDs get a format.
入力スキーマ
{
"type": "object",
"properties": {
"json": {
"type": "string",
"maxLength": 1000000,
"description": "A JSON sample, such as an API response."
},
"strict": {
"description": "Add additionalProperties: false to every object.",
"type": "boolean"
}
},
"required": [
"json"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢json_to_types(json, language, rootName)
Generate types for a JSON sample in TypeScript, Go (with json tags), Python (Pydantic), Java (records with Jackson), C# (System.Text.Json), Kotlin (kotlinx.serialization) or Rust (serde). Optional and nullable fields are worked out from every item in arrays.
入力スキーマ
{
"type": "object",
"properties": {
"json": {
"type": "string",
"maxLength": 1000000,
"description": "A JSON sample, such as an API response."
},
"language": {
"type": "string",
"enum": [
"typescript",
"go",
"python",
"java",
"csharp",
"kotlin",
"rust"
]
},
"rootName": {
"description": "Name of the top-level type; Root by default.",
"type": "string",
"maxLength": 60
}
},
"required": [
"json",
"language"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢curl_to_code(command, language)
Turn a cURL command (bash, Windows cmd or PowerShell, as copied from browser devtools) into the same request in Python requests, JavaScript fetch or axios, Go, Java, C#, PHP, or a tidy cURL command. Headers, body, auth, timeouts and redirects are carried over.
入力スキーマ
{
"type": "object",
"properties": {
"command": {
"type": "string",
"maxLength": 1000000,
"description": "The cURL command."
},
"language": {
"type": "string",
"enum": [
"python",
"fetch",
"axios",
"go",
"java",
"csharp",
"php",
"curl"
]
}
},
"required": [
"command",
"language"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢convert_api_spec(source, to)
Convert between API description formats: OpenAPI 3, Swagger 2.0, a Postman collection, cURL commands or a HAR recording in; OpenAPI 3.1 (JSON or YAML), Swagger 2.0, a Postman collection v2.1, cURL commands or an .http file out. Anything the target format can't hold is listed.
入力スキーマ
{
"type": "object",
"properties": {
"source": {
"type": "string",
"maxLength": 1000000,
"description": "The API description: OpenAPI or Swagger (JSON or YAML), a Postman collection, cURL commands or a HAR file."
},
"to": {
"type": "string",
"enum": [
"openapi-json",
"openapi-yaml",
"swagger-json",
"postman",
"curl",
"http"
]
}
},
"required": [
"source",
"to"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢query_jsonpath(json, path)
Evaluate a JSONPath expression (RFC 9535: filters like $..book[[email protected] < 10], slices, recursive descent, length/count/match/search) against JSON. Returns each match with its normalized path.
入力スキーマ
{
"type": "object",
"properties": {
"json": {
"type": "string",
"maxLength": 1000000,
"description": "The JSON to search."
},
"path": {
"type": "string",
"maxLength": 2000,
"description": "The JSONPath, starting with $."
}
},
"required": [
"json",
"path"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢explain_cron(expression, count)
Read a cron expression (5 fields as in crontab, GitHub Actions and Kubernetes, or 6 with seconds as in Spring/Quartz, or @daily and the other shortcuts) in plain English, and list its next run times in UTC.
入力スキーマ
{
"type": "object",
"properties": {
"expression": {
"type": "string",
"maxLength": 200,
"description": "The cron expression, such as */15 * * * *."
},
"count": {
"description": "How many next run times to list (5 by default).",
"type": "integer",
"minimum": 1,
"maximum": 20
}
},
"required": [
"expression"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢compare_json(original, changed, ignoreArrayOrder)
List the differences between two JSON documents by their data, not their text: key order never counts, and array order can be ignored. Each difference has its JSONPath and both values.
入力スキーマ
{
"type": "object",
"properties": {
"original": {
"type": "string",
"maxLength": 1000000,
"description": "The first JSON document."
},
"changed": {
"type": "string",
"maxLength": 1000000,
"description": "The second JSON document."
},
"ignoreArrayOrder": {
"description": "Match array items by content instead of position.",
"type": "boolean"
}
},
"required": [
"original",
"changed"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢get_test_data(resource, limit, id)
Fetch realistic sample records from the free testingapis.com API to use as test data or fixtures: products (with prices, categories, ratings), blog posts or todos. Every record comes from a real, public REST endpoint the user can also call.
入力スキーマ
{
"type": "object",
"properties": {
"resource": {
"type": "string",
"enum": [
"products",
"posts",
"todos"
]
},
"limit": {
"description": "How many records (5 by default).",
"type": "integer",
"minimum": 1,
"maximum": 20
},
"id": {
"description": "One record by its id, instead of a list.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"resource"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}コミュニティ
エビデンス