agentsclimarketplace

Json response validation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/json-response-validation

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill json-response-validation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when after sending HTTP requests to API endpoints (such as /classify or /model/metadata on an NP-Classifier server) to verify that the response is parseable JSON and contains the expected output fields and metadata before attempting to extract or process the data programmatically.

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.3 KB, 954 tokens by cl100k_base, as published. Nobody here has run it

json-response-validation

Summary

Validate that API endpoints return well-formed JSON responses with expected fields, correct HTTP status codes, and proper schema structure. This skill ensures that downstream programmatic consumers of the API can reliably parse and use the returned data.

When to use

Apply this skill after sending HTTP requests to API endpoints (such as /classify or /model/metadata on an NP-Classifier server) to verify that the response is parseable JSON and contains the expected output fields and metadata before attempting to extract or process the data programmatically.

When NOT to use

  • The API endpoint is known to return non-JSON responses (e.g., plain text, HTML, binary data).
  • You are validating against a different schema than what the API documentation specifies.
  • The response has already been validated upstream by a trusted intermediary.

Inputs

  • HTTP response body (raw text)
  • HTTP status code (integer)

Outputs

  • Parsed JSON object
  • Validation report (pass/fail for status code, parseability, and field presence)
  • JSON file containing the validated response

How to apply

After sending an HTTP GET request to an API endpoint, capture the full response including the status code and body. Parse the response body as JSON and verify that the HTTP status code is 200. Extract and inspect key fields: for the /classify endpoint, confirm the presence of the 'output' field; for /model/metadata, validate that input layers are named 'input_2048' and 'input_4096' and output layer is named 'output'. Write the parsed response to a JSON file for subsequent use. If parsing fails or expected fields are missing, the endpoint is not functioning correctly.

Related tools

  • TensorFlow Serving (Provides the /model/metadata endpoint whose response structure and layer names must be validated)
  • docker-compose (Orchestrates the NP-Classifier server and TensorFlow Serving containers that expose the API endpoints being validated)
  • Python (Programmatic language used to construct HTTP requests, parse JSON responses, and validate response structure)

Examples

import requests; import json; response = requests.get('http://localhost:8500/model/metadata'); assert response.status_code == 200; metadata = response.json(); print(json.dumps(metadata, indent=2))

Evaluation signals

  • HTTP status code is 200 (not 4xx or 5xx).
  • Response body is valid JSON (parses without throwing a JSONDecodeError).
  • For /classify endpoint: 'output' field is present in the response object.
  • For /model/metadata endpoint: input layer names 'input_2048' and 'input_4096' and output layer name 'output' are present in the metadata.
  • Validated response can be successfully written to and re-read from a JSON file without data loss.

Limitations

  • This skill validates only structure and presence of expected fields; it does not validate the semantic correctness or accuracy of the classification output itself.
  • The skill assumes the NP-Classifier Docker services (server and TensorFlow Serving) are already running; it does not diagnose service startup or connectivity issues.
  • Validation success does not guarantee that the model weights are correct or that the classification results are scientifically valid; it only confirms that the API contract is being met.

Evidence

  • [other] Validate the response structure contains the expected output field 'output' and verify the presence of input layer names 'input_2048' and 'input_4096' in the response metadata or schema.: "Validate the response structure contains the expected output field 'output' and verify the presence of input layer names 'input_2048' and 'input_4096' in the response metadata or schema."
  • [other] Confirm the HTTP status code is 200 and the response is well-formed JSON.: "Confirm the HTTP status code is 200 and the response is well-formed JSON."
  • [other] Parse the JSON response and extract input/output layer name fields. Validate that input layers are named 'input_2048' and 'input_4096' and output layer is named 'output'.: "Parse the JSON response and extract input/output layer name fields. Validate that input layers are named 'input_2048' and 'input_4096' and output layer is named 'output'."
  • [readme] Input layers' names should be "input_2048" and "input_4096"

Output layer's name should be "output": "Input layers' names should be "input_2048" and "input_4096"

Output layer's name should be "output""

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.