Skip to content

System Functions

Reserved namespaces and built-in functions


Function names beginning with forrst. 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 forrst. 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
forrst.<category>.<action>

Categories:

  • urn:cline:forrst:fn:ping — Simple connectivity check
  • urn:cline:forrst:fn:health — Comprehensive health check
  • urn:cline:forrst:fn:describe — Introspection
  • urn:cline:forrst:fn:capabilities — Feature discovery
  • urn:cline:forrst:ext:atomic-lock:fn:* — Atomic lock management (see Atomic Lock)

Some extensions provide their own functions within the forrst. namespace. These functions are only available when their parent extension is enabled:

ExtensionFunctions
Asyncurn:cline:forrst:ext:async:fn:status, urn:cline:forrst:ext:async:fn:cancel, urn:cline:forrst:ext:async:fn:list
Replayforrst.replay.* (if implemented)

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

Request:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_health",
"call": {
"function": "urn:cline:forrst:fn:ping",
"version": "1.0.0",
"arguments": {}
}
}

Response:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_health",
"result": {
"status": "healthy",
"timestamp": "2024-01-15T10:30:00Z"
},
"extensions": [
{
"urn": "urn:forrst: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": "forrst", "version": "0.1.0" },
"id": "req_health",
"call": {
"function": "urn:cline:forrst:fn:health",
"version": "1.0.0",
"arguments": {}
}
}

Response:

{
"protocol": { "name": "forrst", "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": "urn:cline:forrst:fn:health",
"version": "1.0.0",
"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",
"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",
"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": "forrst", "version": "0.1.0" },
"id": "req_caps",
"call": {
"function": "urn:cline:forrst:fn:capabilities",
"version": "1.0.0",
"arguments": {}
}
}

Response:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_caps",
"result": {
"service": "orders-api",
"protocol_versions": ["0.1.0"],
"extensions": [
{
"urn": "urn:forrst:ext:async",
"documentation": "urn:forrst: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 Forrst protocol versions
extensionsarrayServer-wide supported extensions (see note)
functionsarrayAvailable function names (without versions)
limitsobjectService limits

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


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

Request:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_describe",
"call": {
"function": "urn:cline:forrst:fn:describe",
"version": "1.0.0",
"arguments": {
"function": "orders.create"
}
}
}

Response:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_describe",
"result": {
"function": "orders.create",
"description": "Create a new order",
"side_effects": ["create"],
"versions": [
{
"version": "1.0.0",
"stability": "stable",
"description": "Original version",
"deprecated": {
"reason": "Use version 2.0.0 for improved validation",
"sunset": "2025-06-01"
}
},
{
"version": "2.0.0",
"stability": "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.0.0",
"stability": "beta",
"description": "Beta with async support"
}
],
"recommended_version": "2.0.0"
}
}

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, urn:cline:forrst:fn:describe returns pagination capabilities:

{
"result": {
"function": "orders.list",
"description": "List orders with filtering and pagination",
"side_effects": [],
"versions": [
{
"version": "1.0.0",
"stability": "stable",
"pagination": {
"styles": ["cursor", "offset"],
"default_style": "cursor",
"default_limit": 50,
"max_limit": 100
}
}
],
"recommended_version": "1.0.0"
}
}
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.0.0",
"stability": "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.0.0",
"stability": "stable",
"extensions": {
"supported": ["urn:forrst:ext:idempotency", "urn:forrst:ext:dry-run", "urn:forrst: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.0.0",
"stability": "stable",
"extensions": {
"excluded": ["urn:forrst:ext:idempotency", "urn:forrst: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",
"source": { "pointer": "/extensions/0" },
"details": {
"extension": "urn:forrst:ext:caching",
"function": "orders.create"
}
}]
}

See Errors for the full error specification.


System functions for managing atomic locks acquired via the Atomic Lock extension. These functions enable cross-process lock release and status monitoring.

urn:cline:forrst:ext:atomic-lock:fn:release

Section titled “urn:cline:forrst:ext:atomic-lock:fn:release”

Release a lock with ownership verification. Requires the owner token from lock acquisition.

Request:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_lock_release",
"call": {
"function": "urn:cline:forrst:ext:atomic-lock:fn:release",
"version": "1.0.0",
"arguments": {
"key": "forrst_lock:payments.charge:user:123",
"owner": "550e8400-e29b-41d4-a716-446655440000"
}
}
}

Arguments:

FieldTypeRequiredDescription
keystringYesFull lock key (with scope prefix)
ownerstringYesOwner token from lock acquisition

Returns:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_lock_release",
"result": {
"released": true,
"key": "forrst_lock:payments.charge:user:123"
}
}
FieldTypeDescription
releasedbooleanWhether release was successful
keystringThe lock key that was released

Errors:

CodeDescription
LOCK_NOT_FOUNDLock does not exist or has expired
LOCK_OWNERSHIP_MISMATCHProvided owner token does not match

urn:cline:forrst:ext:atomic-lock:fn:force-release

Section titled “urn:cline:forrst:ext:atomic-lock:fn:force-release”

Administratively release a lock without ownership verification. Use with caution as this can interrupt in-progress operations.

Request:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_lock_force",
"call": {
"function": "urn:cline:forrst:ext:atomic-lock:fn:force-release",
"version": "1.0.0",
"arguments": {
"key": "forrst_lock:payments.charge:user:123"
}
}
}

Arguments:

FieldTypeRequiredDescription
keystringYesFull lock key (with scope prefix)

Returns:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_lock_force",
"result": {
"released": true,
"key": "forrst_lock:payments.charge:user:123",
"forced": true
}
}
FieldTypeDescription
releasedbooleanWhether release was successful
keystringThe lock key that was released
forcedbooleanAlways true for force release

Errors:

CodeDescription
LOCK_NOT_FOUNDLock does not exist

urn:cline:forrst:ext:atomic-lock:fn:status

Section titled “urn:cline:forrst:ext:atomic-lock:fn:status”

Check the status of a lock. Useful for debugging lock contention and monitoring.

Request:

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_lock_status",
"call": {
"function": "urn:cline:forrst:ext:atomic-lock:fn:status",
"version": "1.0.0",
"arguments": {
"key": "forrst_lock:payments.charge:user:123"
}
}
}

Arguments:

FieldTypeRequiredDescription
keystringYesFull lock key (with scope prefix)

Returns (locked):

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_lock_status",
"result": {
"key": "forrst_lock:payments.charge:user:123",
"locked": true,
"owner": "550e8400-e29b-41d4-a716-446655440000",
"acquired_at": "2024-01-15T10:30:00Z",
"expires_at": "2024-01-15T10:30:30Z",
"ttl_remaining": 25
}
}

Returns (unlocked):

{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_lock_status",
"result": {
"key": "forrst_lock:payments.charge:user:123",
"locked": false
}
}
FieldTypeDescription
keystringThe lock key
lockedbooleanWhether the lock is currently held
ownerstringOwner token (only if locked)
acquired_atstringISO 8601 acquisition timestamp (only if locked)
expires_atstringISO 8601 expiration timestamp (only if locked)
ttl_remainingintegerSeconds until lock expires (only if locked)

Errors: None — status check always succeeds


These namespaces are reserved for potential future use:

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

Servers SHOULD implement:

  • urn:cline:forrst:fn:ping — Simple connectivity check
  • urn:cline:forrst:fn:health — Comprehensive health check

Servers SHOULD implement if applicable:

  • urn:cline:forrst:fn:capabilities — For service discovery
  • urn:cline:forrst:fn:describe — For API exploration
  • urn:cline:forrst:ext:atomic-lock:fn:* — If supporting atomic lock extension

When enabling extensions that provide functions, servers MUST register those functions:

  • urn:cline:forrst:ext:async:fn:* — Provided by Async extension
FunctionPurposeUse Case
urn:cline:forrst:fn:pingFast connectivity checkHeartbeats, basic liveness
urn:cline:forrst:fn:healthDependency-aware healthLoad balancers, readiness probes

Use urn:cline:forrst:fn:ping when you just need to know if the service is reachable. Use urn:cline:forrst:fn: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 forrst. prefix.


// Request
{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "health_001",
"call": {
"function": "urn:cline:forrst:fn:ping",
"version": "1.0.0"
}
}
// Response
{
"protocol": { "name": "forrst", "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": "forrst", "version": "0.1.0" },
"id": "discover_001",
"call": {
"function": "urn:cline:forrst:fn:capabilities",
"version": "1.0.0"
}
}
// Response
{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "discover_001",
"result": {
"service": "user-service",
"protocol_versions": ["0.1.0"],
"extensions": [
{ "urn": "urn:forrst:ext:async" }
],
"functions": [
"users.create",
"users.get",
"users.update",
"users.delete",
"users.list"
],
"limits": {
"default_deadline": { "value": 10, "unit": "second" }
}
}
}
{
"protocol": { "name": "forrst", "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"
}
}