Skip to content

System Functions

Reserved namespaces and built-in functions


Function names beginning with vend. are reserved for system functions. Applications MUST NOT define functions in this namespace.

System functions provide protocol-level capabilities like health checks, introspection, and operation management.


  • Function names starting with vend. are reserved
  • Applications MUST NOT define custom functions with this prefix
  • Servers SHOULD implement core system functions
  • Clients MAY call system functions like any other function
vend.<category>.<action>

Categories:

  • vend.ping — Simple connectivity check
  • vend.health — Comprehensive health check
  • vend.describe — Introspection
  • vend.capabilities — Feature discovery
  • vend.operation.* — Async operation management
  • vend.replay.* — Replay queue management

Health check function. MUST return immediately if service is healthy.

Request:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_health",
"call": {
"function": "vend.ping",
"version": "1",
"arguments": {}
}
}

Response:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_health",
"result": {
"status": "healthy",
"timestamp": "2024-01-15T10:30:00Z"
},
"extensions": [
{
"urn": "urn:vnd:ext:tracing",
"data": {
"trace_id": "tr_abc123",
"span_id": "span_server_001",
"duration": { "value": 1, "unit": "millisecond" }
}
}
],
"meta": {
"node": "orders-api-2"
}
}

Arguments: None required

Returns:

FieldTypeDescription
statusstringHealth status: MUST be one of healthy, degraded, unhealthy
timestampstringMUST be ISO 8601 timestamp
detailsobjectOPTIONAL additional health info

Comprehensive health check with component-level status. Use for load balancer health checks, dependency monitoring, and operational visibility.

Request:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_health",
"call": {
"function": "vend.health",
"version": "1",
"arguments": {}
}
}

Response:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_health",
"result": {
"status": "healthy",
"components": {
"database": {
"status": "healthy",
"latency": { "value": 2, "unit": "millisecond" }
},
"cache": {
"status": "healthy",
"latency": { "value": 1, "unit": "millisecond" }
},
"queue": {
"status": "healthy"
}
},
"timestamp": "2024-01-15T10:30:00Z"
}
}

Arguments:

FieldTypeRequiredDescription
componentstringNoCheck specific component only
include_detailsbooleanNoInclude detailed check info (default: true)

Returns:

FieldTypeDescription
statusstringAggregate status (see below)
componentsobjectComponent health status
functionsobjectFunction-level health (optional)
timestampstringISO 8601 timestamp
versionstringOptional service version
StatusDescriptionHTTP Equivalent
healthyAll systems operational200
degradedFunctional but impaired200
unhealthyNot able to serve requests503

Each component in components contains:

FieldTypeDescription
statusstringComponent status
latencyobjectOptional response time
messagestringOptional status message
last_checkstringOptional last successful check time

The top-level status MUST reflect the worst component status:

  • If ANY component is unhealthy → aggregate is unhealthy
  • If ANY component is degraded (and none unhealthy) → aggregate is degraded
  • If ALL components are healthy → aggregate is healthy
// Request
{
"call": {
"function": "vend.health",
"version": "1",
"arguments": {
"component": "database"
}
}
}
// Response
{
"result": {
"status": "healthy",
"components": {
"database": {
"status": "healthy",
"latency": { "value": 2, "unit": "millisecond" },
"message": "Primary connection active"
}
},
"timestamp": "2024-01-15T10:30:00Z"
}
}
{
"result": {
"status": "degraded",
"components": {
"database": {
"status": "healthy",
"latency": { "value": 3, "unit": "millisecond" }
},
"cache": {
"status": "degraded",
"message": "Failover to secondary, elevated latency",
"latency": { "value": 45, "unit": "millisecond" }
},
"external_api": {
"status": "healthy"
}
},
"timestamp": "2024-01-15T10:30:00Z"
}
}
{
"result": {
"status": "unhealthy",
"components": {
"database": {
"status": "unhealthy",
"message": "Connection refused",
"last_check": "2024-01-15T10:29:55Z"
},
"cache": {
"status": "healthy"
}
},
"timestamp": "2024-01-15T10:30:00Z"
}
}

For Kubernetes-style probes, use the component argument:

ProbeComponentPurpose
Liveness"self"Is the process alive?
Readiness(omit)Can it serve traffic?
// Liveness probe - just checks if service is running
{
"arguments": {
"component": "self",
"include_details": false
}
}
// Response
{
"result": {
"status": "healthy",
"timestamp": "2024-01-15T10:30:00Z"
}
}

Services SHOULD use these component names when applicable:

ComponentDescription
selfThe service process itself
databasePrimary database
cacheCaching layer (Redis, Memcached)
queueMessage queue
storageObject/file storage
searchSearch engine (Elasticsearch)
<service>_apiExternal service dependency

Functions can report their own health status independently of component health. This enables graceful degradation where some functions remain available while others are temporarily disabled.

FieldTypeDescription
statusstringFunction status (see below)
messagestringOptional explanation
untilstringOptional ISO 8601 timestamp
retry_afterobjectOptional duration before retry
StatusDescription
healthyFunction is fully operational
degradedFunction works but with limitations
disabledFunction turned off (feature flag, deprecated, etc.)
maintenanceFunction under scheduled maintenance
{
"result": {
"status": "degraded",
"components": {
"database": { "status": "healthy" },
"cache": { "status": "healthy" }
},
"functions": {
"reports.generate": {
"status": "disabled",
"message": "Disabled during maintenance window",
"until": "2024-01-15T12:00:00Z"
},
"orders.create": {
"status": "healthy"
},
"orders.list": {
"status": "healthy"
}
},
"timestamp": "2024-01-15T10:30:00Z"
}
}
{
"result": {
"status": "degraded",
"components": {
"database": { "status": "healthy" },
"external_api": { "status": "degraded" }
},
"functions": {
"orders.create": {
"status": "degraded",
"message": "Payment validation disabled, orders require manual review"
},
"exports.create": {
"status": "degraded",
"message": "Rate limited due to high load",
"retry_after": { "value": 30, "unit": "second" }
}
},
"timestamp": "2024-01-15T10:30:00Z"
}
}

Function health contributes to aggregate status:

  • If ANY function is disabled → aggregate is at least degraded
  • Function degraded → aggregate is at least degraded
  • Component unhealthy always takes precedence → aggregate is unhealthy

When a function is marked disabled, calls to that function SHOULD return:

{
"errors": [{
"code": "FUNCTION_DISABLED",
"message": "Function temporarily disabled",
"retryable": false,
"details": {
"function": "reports.generate",
"reason": "Feature flag disabled"
}
}]
}

When a function is marked maintenance, calls MUST return HTTP 503:

{
"errors": [{
"code": "FUNCTION_MAINTENANCE",
"message": "Function under scheduled maintenance",
"retryable": true,
"details": {
"function": "reports.generate",
"reason": "Report engine upgrade",
"until": "2024-01-15T12:00:00Z",
"retry_after": { "value": 30, "unit": "minute" }
}
}]
}

Discover what the service supports.

Request:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_caps",
"call": {
"function": "vend.capabilities",
"version": "1",
"arguments": {}
}
}

Response:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_caps",
"result": {
"service": "orders-api",
"protocol_versions": ["0.1.0"],
"extensions": [
{
"urn": "urn:vnd:ext:async",
"documentation": "urn:vnd:ext:async"
}
],
"functions": [
"orders.create",
"orders.get",
"orders.list",
"orders.cancel"
],
"limits": {
"max_request_bytes": 1048576,
"default_deadline": { "value": 30, "unit": "second" }
}
}
}

Arguments: None required

Returns:

FieldTypeDescription
servicestringService identifier
protocol_versionsarraySupported Vend protocol versions
extensionsarrayServer-wide supported extensions (see note)
functionsarrayAvailable function names (without versions)
limitsobjectService limits

Note: Extensions listed in vend.capabilities represent server-wide defaults. Individual functions MAY restrict which extensions they accept. Use vend.describe to discover per-function extension support.


Get detailed information about a specific function, including schema, side effects, and capabilities.

Request:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_describe",
"call": {
"function": "vend.describe",
"version": "1",
"arguments": {
"function": "orders.create"
}
}
}

Response:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_describe",
"result": {
"function": "orders.create",
"description": "Create a new order",
"side_effects": ["create"],
"versions": [
{
"version": "1",
"status": "stable",
"description": "Original version",
"deprecated": {
"reason": "Use version 2 for improved validation",
"sunset": "2025-06-01"
}
},
{
"version": "2",
"status": "stable",
"description": "Current version with improved validation",
"schema": {
"arguments": {
"type": "object",
"properties": {
"customer_id": { "type": "string" },
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"product_id": { "type": "string" },
"quantity": { "type": "integer", "minimum": 1 }
},
"required": ["product_id", "quantity"]
}
},
"shipping_address": { "$ref": "#/definitions/address" }
},
"required": ["customer_id", "items"]
},
"returns": {
"type": "object",
"properties": {
"id": { "type": "string" },
"status": { "type": "string", "enum": ["pending", "confirmed"] },
"total": { "type": "number" }
}
},
"definitions": {
"address": {
"type": "object",
"properties": {
"street": { "type": "string" },
"city": { "type": "string" },
"country_code": { "type": "string", "pattern": "^[A-Z]{2}$" }
}
}
}
}
},
{
"version": "3",
"status": "beta",
"description": "Beta with async support"
}
],
"recommended_version": "2"
}
}

Arguments:

FieldTypeRequiredDescription
functionstringYesFunction name to describe
versionstringNoSpecific version (returns all if omitted)
include_schemabooleanNoInclude JSON Schema (default: true)

Returns:

FieldTypeDescription
functionstringFunction name
descriptionstringHuman-readable description
side_effectsarraySide effects (see below). Empty array means read-only.
versionsarrayAvailable versions with status
recommended_versionstringSuggested version to use

The side_effects array indicates what state changes a function may cause:

ValueDescription
createCreates new resources
updateModifies existing resources
deleteRemoves resources

An empty array ([]) indicates a read-only function with no side effects.

Each version MAY include a schema object with JSON Schema definitions:

FieldTypeDescription
argumentsobjectJSON Schema for function arguments
returnsobjectJSON Schema for successful result
definitionsobjectShared schema definitions

Schemas use JSON Schema Draft 2020-12 with these extensions:

  • $ref for referencing definitions
  • Standard formats: date-time, email, uri, etc.
StatusDescription
stableProduction-ready, fully supported
betaTesting, MAY change
removedNo longer available (MAY be omitted from list)

Deprecation is indicated by the presence of a deprecated object, not a status value. See Deprecated Object.

For list functions, vend.describe returns pagination capabilities:

{
"result": {
"function": "orders.list",
"description": "List orders with filtering and pagination",
"side_effects": [],
"versions": [
{
"version": "1",
"status": "stable",
"pagination": {
"styles": ["cursor", "offset"],
"default_style": "cursor",
"default_limit": 50,
"max_limit": 100
}
}
],
"recommended_version": "1"
}
}
FieldTypeDescription
stylesarraySupported pagination styles
default_stylestringStyle used when not specified
default_limitintegerItems per page when not specified
max_limitintegerMaximum allowed limit
StyleDescription
cursorOpaque cursor-based pagination
offsetNumeric offset pagination
keysetKey-based pagination (e.g., after_id)

For functions supporting filtering, sorting, and sparse fieldsets:

{
"result": {
"function": "orders.list",
"side_effects": [],
"versions": [
{
"version": "1",
"status": "stable",
"capabilities": {
"filters": {
"self": ["id", "status", "created_at", "total_amount"],
"customer": ["id", "type", "country_code"]
},
"sorts": ["created_at", "total_amount", "status"],
"fields": {
"self": ["id", "status", "total_amount", "created_at", "updated_at"],
"customer": ["id", "name", "email"]
},
"relationships": ["customer", "items", "shipments"]
},
"pagination": {
"styles": ["cursor"],
"default_limit": 50,
"max_limit": 100
}
}
]
}
}
FieldTypeDescription
filtersobjectFilterable attributes by resource
sortsarraySortable attributes
fieldsobjectSelectable fields by resource
relationshipsarrayIncludable relationships

Functions can declare which extensions they support, overriding server-wide defaults:

{
"result": {
"function": "orders.create",
"description": "Create a new order",
"side_effects": ["create"],
"versions": [
{
"version": "2",
"status": "stable",
"extensions": {
"supported": ["urn:vnd:ext:idempotency", "urn:vnd:ext:dry-run", "urn:vnd:ext:tracing"]
}
}
]
}
}
FieldTypeDescription
supportedarrayExtensions this function accepts (allowlist)
excludedarrayExtensions this function rejects (blocklist)
  • If extensions is omitted → function supports all server-wide extensions
  • If supported is present → only listed extensions are accepted
  • If excluded is present → server-wide extensions minus these are accepted
  • MUST NOT specify both supported and excluded
{
"result": {
"function": "orders.list",
"description": "List orders",
"side_effects": [],
"versions": [
{
"version": "1",
"status": "stable",
"extensions": {
"excluded": ["urn:vnd:ext:idempotency", "urn:vnd:ext:dry-run"]
}
}
]
}
}

When a client requests an extension that a function doesn’t support:

{
"errors": [{
"code": "EXTENSION_NOT_APPLICABLE",
"message": "Caching extension not applicable to write operations",
"retryable": false,
"source": { "pointer": "/extensions/0" },
"details": {
"extension": "urn:vnd:ext:caching",
"function": "orders.create"
}
}]
}

See Errors for the full error specification.


Check status of an async operation. See Async.

Request:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_op_status",
"call": {
"function": "vend.operation.status",
"version": "1",
"arguments": {
"operation_id": "op_xyz789"
}
}
}

Arguments:

FieldTypeRequiredDescription
operation_idstringYesOperation ID to check

Returns: See Async for response format.


Cancel a pending async operation.

Request:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_op_cancel",
"call": {
"function": "vend.operation.cancel",
"version": "1",
"arguments": {
"operation_id": "op_xyz789"
}
}
}

Arguments:

FieldTypeRequiredDescription
operation_idstringYesOperation ID to cancel

Returns:

FieldTypeDescription
operation_idstringOperation ID
statusstringNew status (MUST be cancelled)
cancelled_atstringMUST be ISO 8601 timestamp

List operations for the current caller.

Request:

{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "req_op_list",
"call": {
"function": "vend.operation.list",
"version": "1",
"arguments": {
"status": "processing",
"limit": 10
}
}
}

Arguments:

FieldTypeRequiredDescription
statusstringNoFilter by status
functionstringNoFilter by function name
limitintegerNoMax results (default 50)
cursorstringNoPagination cursor

Returns:

{
"operations": [
{
"id": "op_abc123",
"function": "reports.generate",
"version": "1",
"status": "processing",
"progress": 0.45,
"started_at": "2024-01-15T10:30:00Z"
},
{
"id": "op_def456",
"function": "exports.create",
"version": "1",
"status": "processing",
"progress": 0.12,
"started_at": "2024-01-15T10:31:00Z"
}
],
"next_cursor": "eyJpZCI6Im9wX2RlZjQ1NiJ9"
}

These namespaces are reserved for potential future use:

NamespaceIntended Purpose
vend.auth.*Authentication functions
vend.schema.*Schema introspection
vend.metrics.*Metrics and observability
vend.config.*Configuration discovery

Servers SHOULD implement:

  • vend.ping — Simple connectivity check
  • vend.health — Comprehensive health check

Servers SHOULD implement if applicable:

  • vend.capabilities — For service discovery
  • vend.describe — For API exploration
  • vend.operation.* — If supporting async operations
FunctionPurposeUse Case
vend.pingFast connectivity checkHeartbeats, basic liveness
vend.healthDependency-aware healthLoad balancers, readiness probes

Use vend.ping when you just need to know if the service is reachable. Use vend.health when you need to know if the service can actually serve requests (dependencies are healthy).

Organizations MAY define additional system functions within their own namespace:

myorg.system.audit
myorg.system.config

These MUST NOT use the vend. prefix.


// Request
{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "health_001",
"call": {
"function": "vend.ping",
"version": "1"
}
}
// Response
{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "health_001",
"result": {
"status": "healthy",
"timestamp": "2024-01-15T10:30:00Z",
"details": {
"database": "connected",
"cache": "connected",
"queue": "connected"
}
}
}
// Request
{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "discover_001",
"call": {
"function": "vend.capabilities",
"version": "1"
}
}
// Response
{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "discover_001",
"result": {
"service": "user-service",
"protocol_versions": ["0.1.0"],
"extensions": [
{ "urn": "urn:vnd:ext:async" }
],
"functions": [
"users.create",
"users.get",
"users.update",
"users.delete",
"users.list"
],
"limits": {
"default_deadline": { "value": 10, "unit": "second" }
}
}
}
{
"protocol": { "name": "vend", "version": "0.1.0" },
"id": "health_002",
"result": {
"status": "degraded",
"timestamp": "2024-01-15T10:30:00Z",
"details": {
"database": "connected",
"cache": "disconnected",
"queue": "connected"
},
"message": "Cache unavailable, operating with degraded performance"
}
}