Purpose and scope
This is version 1 of the declarative public HTTP-operation format used by listof.tools. A definition describes one anonymous, read-only operation, its user inputs, request construction, output type and optional expected-response check. It can be used to generate a form or an agent integration. The provider request may be GET or a read-only POST.
This document covers external HTTP operations and the submission format. Editor-defined native dataset adapters, review receipts, votes, health records, runner URLs and other catalogue enrichment are outside its scope. A definition is data, not permission to execute it. Provider eligibility and read-only behavior require review; validation cannot establish them.
Object fields and text conventions
Definitions are JSON objects. Unknown top-level fields are rejected. Required fields are name, provider, description, documentation, endpoint, method, output, parameters and example. The only optional fields are category, fixedQuery, fixedHeaders, bodyTemplate, queryTemplate and check. A submitted definition additionally requires check; a base definition can omit it.
Unless explicitly stated otherwise, string limits below count JavaScript UTF-16 code units, not Unicode code points or UTF-8 bytes. A bounded display-text field must be a nonempty string after trimming, must not contain ASCII U+0000–U+001F or U+007F, and is checked against its length limit before trimming. Store its trimmed value. This applies to name, provider, category, description, parameter labels/names/examples, choices and expected text values. Runtime user inputs have separate rules below.
| Field | Rules |
|---|---|
| name, provider | Bounded display text, at most 80 units each. |
| category | Bounded display text, at most 40; absent or empty uses Other. |
| description | Bounded display text, at most 500. |
| documentation, endpoint | Public HTTPS URLs as defined below; at most 500 units before URL serialization. |
| method | Exactly GET or POST. POST must be read-only. |
| output | Exactly json, text or image; image means PNG. |
| parameters | Ordered array of zero to eight parameter objects. |
| example | Object of runtime input values, validated by the same rules as a user request. It cannot contain undeclared names. |
| fixedQuery, fixedHeaders | Optional constant string maps; omitted maps normalize to empty objects. |
| bodyTemplate | Required only for POST; forbidden for GET. |
| queryTemplate | Optional GET-only query-string templates. |
| check | Expected result check. Required for submissions. |
Public definition URLs and constant maps
Parse a trimmed definition URL with JavaScript URL semantics. Require HTTPS, no credentials, no nondefault port, no fragment, and a dotted ASCII hostname. Nonfinal labels start and end in an ASCII letter or digit, otherwise contain letters, digits or hyphens, and are at most 63 units. The final label starts with a letter, otherwise contains letters, digits or hyphens, and is 2–63 units. Internationalized hosts are normalized through URL parsing. Reject hostnames equal to or beneath localhost, local, internal, test, invalid, listof.tools or entity-pages.workers.dev. IP literals do not qualify. Explicit port 443 normalizes to the default port. Store the URL serialization.
These URL rules apply to documentation and endpoint. Endpoint query parameter names containing, case-insensitively, api followed by an optional character and key, or token, password or secret, are rejected. These are syntactic checks, not DNS validation or a comprehensive secret detector.
Each constant map has at most eight entries. Keys match ^[a-zA-Z0-9_.-]{1,64}$; values are strings of at most 512 units with no ASCII controls or DEL. Empty values are allowed. Keys __proto__, prototype and constructor are forbidden. Keys matching authorization, cookie, api.?key, token, password or secret case-insensitively are forbidden. Header keys may only be Accept or x-api-version, case-insensitively. A fixedQuery key cannot equal a user parameter name.
Parameter objects
Only these fields are allowed: name, label, type, required, maxLength, example, choices, minItems, maxItems.
Names are unique and match ^[a-zA-Z][a-zA-Z0-9_-]*$, at most 40 units, excluding the three forbidden keys above. Label is bounded display text of at most 80 units and defaults to name. Type defaults to text; the only types are text, enum, url and url-list. Required defaults to true and, when provided, must be boolean. MaxLength defaults to 120 and is an integer from 1 to 500 for scalar types, or 1 to 2,048 for url-list items.
An enum requires 1–30 choices, each bounded display text fitting maxLength. Other types cannot have choices. A url-list may specify integer minItems and maxItems, defaulting to 1 and 100, with 1 <= minItems <= maxItems <= 100. Item bounds are forbidden for other types. A scalar parameter example is bounded display text fitting maxLength. A url-list parameter example can be a newline-separated string or an array; normalize it through the list rules below and store it as a newline-separated string. Parameter examples are hints, while the top-level example object must pass runtime validation.
Runtime input validation
Inputs are an object with only declared parameter names. An optional value of undefined or empty string is omitted. Required scalar inputs must be nonblank strings; scalar values remain strings without trimming, must fit maxLength, and cannot contain U+0000–U+0008, U+000B, U+000C, U+000E–U+001F or U+007F. Tabs, LF and CR are permitted in scalar runtime text. Enum values must exactly match a choice.
For url inputs and url-list items, parse with JavaScript URL semantics and require HTTP or HTTPS, no credentials or nondefault port, and the dotted ASCII hostname pattern used above. Reject hostnames equal to or beneath localhost, local, internal, test, invalid, home, lan or corp. IP literals are excluded. This validation retains the original input string; it is not a DNS or content-safety check. Fragments are allowed for runtime URL inputs.
A url-list accepts a JSON array of URL strings or text split on LF/CRLF. For text, trim lines and remove empty lines first; reject raw text longer than maxItems times (maxLength + 2) units. Arrays retain their item strings. Enforce the declared item-count bounds and per-item length limit; reject ASCII controls or DEL in list items. Preserve order and duplicates; the normalized runtime value is an array. An empty array is not an omitted optional input and fails a positive minItems bound.
Constructing the provider request
Start with the fixed endpoint and apply fixedQuery entries using URLSearchParams.set. Thus a fixed value replaces an existing endpoint query value of the same name.
For GET, an optional queryTemplate object has up to eight entries. Keys match ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$, exclude forbidden keys, and cannot collide with a fixedQuery key or a parameter name. Values are nonempty strings of at most 4,000 units. Each {{inputName}} placeholder must name a declared required input. Reject malformed leftover {{ or }}. Replace each placeholder with JSON.stringify of its validated runtime value, then set the resulting query value with URLSearchParams.set. Scalars become quoted JSON strings; lists become JSON arrays. This serialization is not a general injection-safety guarantee for an arbitrary provider language; template authors must use a compatible literal grammar. Inputs consumed by templates are not added again as ordinary query parameters. Add remaining validated inputs by name through URLSearchParams.set; JavaScript string conversion makes a remaining list comma-separated. Use a body template when the provider expects a JSON array instead.
For POST, bodyTemplate must be an object. Its root is depth 0; reject any visited value deeper than 4. Strings are at most 500 units. Any string beginning with $ must consist of $ followed by the exact name of a declared input. Other strings, JSON numbers, booleans and null are literals; arrays and objects recurse. Reject the three forbidden object keys at every depth. During JSON serialization, replace a whole string beginning with $ with the matching validated input, preserving its type. There is no interpolation inside a larger string. An absent optional input becomes undefined, so JSON serialization omits an object property or emits null for an array entry. POST applies fixedQuery but does not append ordinary user inputs to the URL.
Provider URL construction must retain the registered HTTPS origin and pathname. Execution uses the declared method, output-specific Accept type (application/json, text/plain or image/png), allowed fixed headers and application/json Content-Type for POST. Do not forward visitor cookies or credentials. listof.tools' server checks use manual redirects, a 15-second deadline and a 256-KiB response bound; those are execution-policy limits, not extra definition fields.
Expected-response checks
For json output, check is an object with only path, type and optional equals. Path is at most 160 units: an empty string for the root or a JSON Pointer beginning with slash; only ~0 and ~1 escapes are accepted. Traverse own properties, decoding ~1 to slash and ~0 to tilde. Missing properties fail. Type is object, array, string, number, boolean or null; arrays and null are distinct from objects. Equals can only be a primitive matching type, with finite numbers and strings of at most 500 units; compare strictly.
For text output, check contains exactly one of contains or equals, with bounded display text of at most 500 units. Contains searches the decoded response unchanged; equals compares the trimmed decoded response. For image output, check is an empty object, and the response must have an image/png content type and PNG's eight-byte signature.
JSON/text responses must be valid UTF-8, nonempty, and not HTML. JSON responses must have a JSON content type, parse as JSON, and must not have a truthy root error value or root success equal to false before the field check. A passed example establishes one observed result under its test conditions, not general correctness, safety or provider availability.
Structural JSON Schema
This is the structural schema served by listof.tools when this version was published. Apply all semantic rules above as well: the schema alone does not enforce URL eligibility, defaults, field relationships or the submission requirement for check. The schema's parameter example describes its normalized string representation; the runtime validator also accepts url-list arrays as described above.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "listof.tools tool definition",
"type": "object",
"additionalProperties": false,
"required": [
"name",
"provider",
"description",
"documentation",
"endpoint",
"method",
"output",
"parameters",
"example"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"provider": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"category": {
"type": "string",
"maxLength": 40
},
"description": {
"type": "string",
"minLength": 1,
"maxLength": 500
},
"documentation": {
"type": "string",
"format": "uri",
"pattern": "^https://",
"maxLength": 500
},
"endpoint": {
"type": "string",
"format": "uri",
"pattern": "^https://",
"maxLength": 500
},
"method": {
"enum": [
"GET",
"POST"
]
},
"output": {
"enum": [
"json",
"text",
"image"
]
},
"parameters": {
"type": "array",
"maxItems": 8,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_-]*$",
"maxLength": 40
},
"label": {
"type": "string",
"maxLength": 80
},
"type": {
"enum": [
"text",
"enum",
"url",
"url-list"
],
"default": "text"
},
"required": {
"type": "boolean",
"default": true
},
"maxLength": {
"type": "integer",
"minimum": 1,
"maximum": 2048,
"description": "Per-item length for url-list (up to 2048); other types allow up to 500."
},
"minItems": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"maxItems": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"example": {
"type": "string",
"maxLength": 2048
},
"choices": {
"type": "array",
"minItems": 1,
"maxItems": 30,
"items": {
"type": "string"
}
}
}
}
},
"example": {
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"maxItems": 100,
"items": {
"type": "string",
"format": "uri",
"maxLength": 2048
}
}
]
}
},
"fixedQuery": {
"type": "object",
"maxProperties": 8,
"additionalProperties": {
"type": "string",
"maxLength": 512
}
},
"fixedHeaders": {
"type": "object",
"maxProperties": 8,
"additionalProperties": {
"type": "string",
"maxLength": 512
}
},
"bodyTemplate": {
"type": "object",
"description": "For read-only POST requests. Replace \"$inputName\" values with the matching input."
},
"queryTemplate": {
"type": "object",
"maxProperties": 8,
"description": "For GET queries: {{inputName}} becomes a quoted JSON/SPARQL string literal, never raw query code. References must name required inputs.",
"additionalProperties": {
"type": "string",
"minLength": 1,
"maxLength": 4000
}
},
"check": {
"description": "Required for submissions: expected JSON field/type, text value or PNG check.",
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"path",
"type"
],
"properties": {
"path": {
"type": "string",
"maxLength": 160
},
"type": {
"enum": [
"object",
"array",
"string",
"number",
"boolean",
"null"
]
},
"equals": {
"type": [
"string",
"number",
"boolean",
"null"
]
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"contains"
],
"properties": {
"contains": {
"type": "string",
"minLength": 1,
"maxLength": 500
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"equals"
],
"properties": {
"equals": {
"type": "string",
"minLength": 1,
"maxLength": 500
}
}
},
{
"type": "object",
"maxProperties": 0
}
]
}
}
}
Executable conformance examples
These illustrative provider addresses are fixtures; conformance does not require contacting them. Validate each definition as a submission, construct its request from its top-level example and compare with expectedUrl and, for POST, expectedBody. All three accept a JSON response {"items":[]} with Content-Type application/json.
[
{
"name": "GET with fixed and user query values",
"definition": {
"name": "Search example records",
"provider": "Example API",
"category": "Data",
"description": "Return matching public records from an illustrative read-only API.",
"documentation": "https://api.example.com/docs",
"endpoint": "https://api.example.com/search",
"method": "GET",
"output": "json",
"parameters": [
{
"name": "q",
"label": "Search",
"type": "text",
"required": true,
"maxLength": 80
}
],
"example": {
"q": "red & blue"
},
"fixedQuery": {
"limit": "5"
},
"check": {
"path": "/items",
"type": "array"
}
},
"expectedUrl": "https://api.example.com/search?limit=5&q=red+%26+blue"
},
{
"name": "GET query template quotes input as a JSON literal",
"definition": {
"name": "Search example records",
"provider": "Example API",
"category": "Data",
"description": "Return matching public records from an illustrative read-only API.",
"documentation": "https://api.example.com/docs",
"endpoint": "https://api.example.com/search",
"method": "GET",
"output": "json",
"parameters": [
{
"name": "q",
"label": "Search",
"type": "text",
"required": true,
"maxLength": 80
}
],
"example": {
"q": "red & blue"
},
"fixedQuery": {
"limit": "5"
},
"check": {
"path": "/items",
"type": "array"
},
"queryTemplate": {
"query": "name:{{q}}"
}
},
"expectedUrl": "https://api.example.com/search?limit=5&query=name%3A%22red+%26+blue%22"
},
{
"name": "POST substitutes an array without converting it to text",
"definition": {
"name": "Inspect example links",
"provider": "Example API",
"category": "Data",
"description": "Return matching public records from an illustrative read-only API.",
"documentation": "https://api.example.com/docs",
"endpoint": "https://api.example.com/inspect",
"method": "POST",
"output": "json",
"parameters": [
{
"name": "urls",
"type": "url-list",
"required": true,
"maxLength": 2048,
"minItems": 1,
"maxItems": 2
}
],
"example": {
"urls": [
"https://example.com/a",
"https://example.com/b"
]
},
"fixedQuery": {},
"check": {
"path": "/items",
"type": "array"
},
"bodyTemplate": {
"urls": "$urls",
"preview": false
}
},
"expectedUrl": "https://api.example.com/inspect",
"expectedBody": "{\"urls\":[\"https://example.com/a\",\"https://example.com/b\"],\"preview\":false}"
}
]
Starting with the first example's definition, apply each patch below and require submission validation to fail. A missing check is represented by deleting that member (the last patch omits it in JSON below, and is described by its name). Base-definition validation without the submission requirement may omit check.
[
{
"name": "HTTP endpoint",
"patch": {
"endpoint": "http://api.example.com/search"
}
},
{
"name": "IP endpoint",
"patch": {
"endpoint": "https://127.0.0.1/"
}
},
{
"name": "credential-bearing endpoint",
"patch": {
"endpoint": "https://user:pass@api.example.com/"
}
},
{
"name": "authentication header",
"patch": {
"fixedHeaders": {
"Authorization": "Bearer EXAMPLE"
}
}
},
{
"name": "undeclared executable field",
"patch": {
"testCode": "EXAMPLE ONLY"
}
},
{
"name": "undeclared example input",
"patch": {
"example": {
"q": "record",
"extra": "value"
}
}
},
{
"name": "query template references an undeclared input",
"patch": {
"queryTemplate": {
"query": "name:{{missing}}"
}
}
},
{
"name": "query template references an optional input",
"patch": {
"parameters": [
{
"name": "q",
"label": "Search",
"type": "text",
"required": false,
"maxLength": 80
}
],
"queryTemplate": {
"query": "name:{{q}}"
}
}
},
{
"name": "fixed query collides with input",
"patch": {
"fixedQuery": {
"q": "fixed"
}
}
},
{
"name": "GET carries a POST body template",
"patch": {
"bodyTemplate": {
"query": "$q"
}
}
},
{
"name": "POST body refers to undeclared input",
"patch": {
"method": "POST",
"bodyTemplate": {
"query": "$missing"
}
}
},
{
"name": "wrong output check type",
"patch": {
"check": {
"path": "/items",
"type": "number",
"equals": "1"
}
}
},
{
"name": "missing submission check",
"patch": {},
"delete": [
"check"
]
}
]
Provenance and use
The local implementation, public live schema, request builders and output checks were checked against these vectors before publication, without sending fixture requests to providers. The format is used by listof.tools' external-operation catalogue and reviewed submissions. Its live documentation and schema can evolve; cite this permanent publication for these exact rules. Native dataset adapters remain outside this format.
Public guide: https://listof.tools/api Live structural schema: https://listof.tools/api/tool-schema
Reuse
The publisher dedicates this publication to the public domain under CC0 1.0 Universal.