Skip to content

Description

Machine-readable API description for Forrst services


Forrst Description provides a standardized interface description format for Forrst APIs. It enables both humans and machines to discover service capabilities without accessing source code or documentation.

Services supporting description MUST implement urn:cline:forrst:fn:describe.


Current Version: 0.1

Version follows Semantic Versioning. Tools supporting version 0.1.0 should work with all 0.1.x documents.


The root object describing a Forrst service.

FieldTypeRequiredDescription
forrststringYESForrst protocol version (e.g., "0.1.0")
describestringYESDescription spec version (e.g., "0.1.0")
infoInfo ObjectYESService metadata
servers[Server Object]NOConnectivity information
functions[Function Object]YESAvailable functions
resourcesMap[string, Resource Object]NOResource type definitions
componentsComponents ObjectNOReusable definitions
external_docsExternal Documentation ObjectNOAdditional documentation
{
"forrst": "0.1.0",
"describe": "0.1.0",
"info": {
"title": "Orders API",
"version": "2.3.0",
"description": "Order management service"
},
"functions": [
{
"name": "orders.get",
"version": "2.0.0",
"summary": "Retrieve an order by ID",
"arguments": [...],
"result": {...}
}
]
}

Provides service metadata.

FieldTypeRequiredDescription
titlestringYESService title
versionstringYESService version (not protocol version)
descriptionstringNOService description (Markdown supported)
terms_of_servicestringNOURL to terms of service
contactContact ObjectNOContact information
licenseLicense ObjectNOLicense information
FieldTypeRequired
namestringNO
urlstringNO
emailstringNO
FieldTypeRequired
namestringYES
urlstringNO
{
"info": {
"title": "Orders API",
"version": "2.3.0",
"description": "Manages customer orders and fulfillment",
"contact": {
"name": "Platform Team",
"email": "platform@example.com"
},
"license": {
"name": "Proprietary"
}
}
}

Represents a server endpoint.

FieldTypeRequiredDescription
namestringYESServer name
urlstringYESServer URL (supports variables)
descriptionstringNOServer description
variablesMap[string, Server Variable]NOURL template variables
FieldTypeRequiredDescription
enum[string]NOAllowed values
defaultstringYESDefault value
descriptionstringNOVariable description
{
"servers": [
{
"name": "production",
"url": "https://orders-api.internal",
"description": "Production cluster"
},
{
"name": "staging",
"url": "https://orders-api.staging.internal",
"description": "Staging environment"
}
]
}

Describes a callable function. Each function name + version combination MUST be unique.

FieldTypeRequiredDescription
namestringYESFunction name (e.g., orders.create)
versionstringYESFunction version
summarystringNOBrief description
descriptionstringNODetailed description (Markdown supported)
tags[Tag Object | Reference]NOLogical grouping
arguments[Argument Object]YESFunction parameters
resultResult ObjectNOReturn value schema
errors[Error Definition]NOPossible errors
queryQuery Capabilities ObjectNOQuery features for list functions
deprecatedDeprecated ObjectNODeprecation info (presence indicates deprecated)
side_effects[string]NOSide effects: create, update, delete. Empty array means read-only.
discoverablebooleanNOWhether included in description (default: true)
examples[Example Object]NOUsage examples
external_docsExternal Documentation ObjectNOAdditional documentation

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

ValueDescription
createCreates new resources
updateModifies existing resources
deleteRemoves resources

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

Functions with multiple effects (e.g., sync operations) list all applicable values:

{
"name": "inventory.sync",
"side_effects": ["create", "update", "delete"]
}
{
"name": "orders.create",
"version": "2.0.0",
"summary": "Create a new order",
"description": "Creates an order for a customer with the specified items.",
"tags": [{ "name": "orders" }],
"side_effects": ["create"],
"arguments": [
{
"name": "customer_id",
"schema": { "type": "string" },
"required": true,
"description": "Customer identifier"
},
{
"name": "items",
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/OrderItem" }
},
"required": true,
"description": "Order line items"
}
],
"result": {
"resource": "order",
"description": "The created order"
},
"errors": [
{ "$ref": "#/components/errors/CustomerNotFound" },
{ "$ref": "#/components/errors/InsufficientInventory" }
],
"idempotent": false
}

Functions marked discoverable: false MUST NOT appear in urn:cline:forrst:fn:describe responses. This allows debug, admin, or infrastructure functions to exist without being advertised.

Non-discoverable functions remain callable—they simply aren’t listed in description.


Describes a function parameter.

FieldTypeRequiredDescription
namestringYESParameter name
schemaSchema ObjectYESJSON Schema for the parameter
requiredbooleanNOWhether required (default: false)
summarystringNOBrief description
descriptionstringNODetailed description
defaultanyNODefault value if not provided
deprecatedDeprecated ObjectNODeprecation info (presence indicates deprecated)
examples[any]NOExample values

Ordering Rule: Required parameters SHOULD precede optional parameters.

{
"name": "customer_id",
"schema": {
"type": "string",
"pattern": "^cust_[a-zA-Z0-9]+$"
},
"required": true,
"description": "Unique customer identifier",
"examples": ["cust_abc123"]
}

Describes the function return value.

FieldTypeRequiredDescription
resourcestringNOResource type name (for resource responses)
schemaSchema ObjectNOJSON Schema (for non-resource responses)
collectionbooleanNOWhether returns array of resources (default: false)
descriptionstringNOResult description

One of resource or schema SHOULD be provided.

Single Resource:

{
"result": {
"resource": "order",
"description": "The requested order"
}
}

Resource Collection:

{
"result": {
"resource": "order",
"collection": true,
"description": "List of matching orders"
}
}

Non-Resource:

{
"result": {
"schema": {
"type": "object",
"properties": {
"valid": { "type": "boolean" },
"errors": {
"type": "array",
"items": { "type": "string" }
}
}
},
"description": "Validation result"
}
}

Defines a resource type and its queryable capabilities.

FieldTypeRequiredDescription
typestringYESResource type identifier
descriptionstringNOResource description
attributesMap[string, Attribute Object]YESResource attributes
relationshipsMap[string, Relationship Definition]NOAvailable relationships
meta[Schema Object]NOSchema for resource-level metadata
{
"resources": {
"order": {
"type": "order",
"description": "A customer order",
"attributes": {
"id": {
"schema": { "type": "string" },
"description": "Unique identifier",
"filterable": true,
"sortable": false
},
"order_number": {
"schema": { "type": "string" },
"description": "Human-readable order number",
"filterable": true,
"sortable": true
},
"status": {
"schema": {
"type": "string",
"enum": ["pending", "processing", "shipped", "delivered", "cancelled"]
},
"description": "Order status",
"filterable": true,
"filter_operators": ["equals", "not_equals", "in"],
"sortable": true
},
"total_amount": {
"schema": { "$ref": "#/components/schemas/Money" },
"description": "Order total",
"filterable": true,
"filter_operators": ["equals", "greater_than", "less_than", "between"],
"sortable": true
},
"created_at": {
"schema": { "type": "string", "format": "date-time" },
"description": "Creation timestamp",
"filterable": true,
"filter_operators": ["equals", "greater_than", "less_than", "between"],
"sortable": true
}
},
"relationships": {
"customer": {
"resource": "customer",
"cardinality": "one",
"description": "The ordering customer",
"filterable": true
},
"items": {
"resource": "order_item",
"cardinality": "many",
"description": "Order line items"
}
}
}
}
}

Defines a resource attribute.

FieldTypeRequiredDescription
schemaSchema ObjectYESJSON Schema for the attribute
descriptionstringNOAttribute description
filterablebooleanNOCan be used in filters (default: false)
filter_operators[string]NOAllowed filter operators
sortablebooleanNOCan be used in sorts (default: false)
sparsebooleanNOCan be sparse-selected (default: true)
deprecatedDeprecated ObjectNODeprecation info (presence indicates deprecated)

When filterable is true, specify allowed operators:

OperatorDescription
equalsExact match
not_equalsNot equal
greater_thanGreater than
greater_than_or_equal_toGreater than or equal
less_thanLess than
less_than_or_equal_toLess than or equal
likePattern match (SQL LIKE)
not_likeNegated pattern match
inValue in array
not_inValue not in array
betweenValue between two bounds
is_nullIs null check
is_not_nullIs not null check

If filter_operators is omitted, defaults to ["equals"].


Defines a relationship to another resource.

FieldTypeRequiredDescription
resourcestringYESRelated resource type
cardinalitystringYES"one" or "many"
descriptionstringNORelationship description
filterablebooleanNOCan filter by related attributes
includablebooleanNOCan be included (default: true)
nested[string]NONested relationships allowed (e.g., ["product"])

Describes query features for list/search functions.

FieldTypeRequiredDescription
filtersFilters CapabilityNOFilter support
sortsSorts CapabilityNOSort support
fieldsFields CapabilityNOSparse fieldset support
relationshipsRelationships CapabilityNORelationship inclusion
paginationPagination CapabilityNOPagination support
FieldTypeRequiredDescription
enabledbooleanYESWhether filtering is supported
boolean_logicbooleanNOSupports and/or combinators
resources[string]NOFilterable resource types (default: ["self"])
FieldTypeRequiredDescription
enabledbooleanYESWhether sorting is supported
max_sortsintegerNOMaximum simultaneous sort fields
default_sortSort DefaultNODefault sort if none specified
{
"attribute": "created_at",
"direction": "desc"
}
FieldTypeRequiredDescription
enabledbooleanYESWhether sparse fieldsets supported
default_fieldsMap[string, [string]]NODefault fields per resource type
FieldTypeRequiredDescription
enabledbooleanYESWhether relationship inclusion supported
available[string]NOAvailable relationships
max_depthintegerNOMaximum nesting depth
FieldTypeRequiredDescription
styles[string]YESSupported styles: "offset", "cursor", "keyset"
default_stylestringNODefault pagination style
default_limitintegerNODefault page size
max_limitintegerNOMaximum page size
{
"query": {
"filters": {
"enabled": true,
"boolean_logic": true,
"resources": ["self", "customer"]
},
"sorts": {
"enabled": true,
"max_sorts": 3,
"default_sort": {
"attribute": "created_at",
"direction": "desc"
}
},
"fields": {
"enabled": true,
"default_fields": {
"self": ["id", "order_number", "status", "total_amount", "created_at"]
}
},
"relationships": {
"enabled": true,
"available": ["customer", "items", "shipping_address"],
"max_depth": 2
},
"pagination": {
"styles": ["cursor", "offset"],
"default_style": "cursor",
"default_limit": 25,
"max_limit": 100
}
}
}

Defines a possible error response.

FieldTypeRequiredDescription
codestringYESError code
messagestringYESHuman-readable message
descriptionstringNOWhen this error occurs
detailsSchema ObjectNOSchema for error details field
{
"code": "CUSTOMER_NOT_FOUND",
"message": "Customer not found",
"description": "Returned when the specified customer_id does not exist",
}

Provides a complete request/response example.

FieldTypeRequiredDescription
namestringYESExample name
summarystringNOBrief description
descriptionstringNODetailed explanation
argumentsobjectYESExample parameter values
resultanyNOExpected result (omit for error examples)
errorobjectNOExpected error (for error examples)
{
"examples": [
{
"name": "Create simple order",
"summary": "Creates an order with a single item",
"arguments": {
"customer_id": "cust_abc123",
"items": [
{ "sku": "WIDGET-01", "quantity": 2 }
]
},
"result": {
"data": {
"type": "order",
"id": "ord_xyz789",
"attributes": {
"order_number": "ORD-2024-0001",
"status": "pending",
"total_amount": { "amount": "59.98", "currency": "USD" }
}
}
}
},
{
"name": "Invalid customer",
"summary": "Error when customer doesn't exist",
"arguments": {
"customer_id": "cust_invalid",
"items": [
{ "sku": "WIDGET-01", "quantity": 1 }
]
},
"errors": [{
"code": "CUSTOMER_NOT_FOUND",
"message": "Customer not found",
"source": {
"pointer": "/call/arguments/customer_id"
}
}]
}
]
}

Logical grouping for functions.

FieldTypeRequiredDescription
namestringYESTag name
summarystringNOBrief description
descriptionstringNODetailed description
external_docsExternal Documentation ObjectNOAdditional documentation

Indicates a function is deprecated. Presence of this object means the function is deprecated.

FieldTypeRequiredDescription
reasonstringNOWhy deprecated and what to use instead
sunsetstringNOISO 8601 date when function will be removed
{
"deprecated": {
"reason": "Use version 2.0.0 which supports bulk operations",
"sunset": "2025-06-01"
}
}

Reference to external documentation.

FieldTypeRequiredDescription
urlstringYESDocumentation URL
descriptionstringNODescription

Holds reusable definitions.

FieldTypeDescription
schemasMap[string, Schema Object]Reusable JSON Schemas
argumentsMap[string, Argument Object]Reusable parameters
errorsMap[string, Error Definition]Reusable error definitions
examplesMap[string, Example Object]Reusable examples
tagsMap[string, Tag Object]Reusable tags
resourcesMap[string, Resource Object]Reusable resource definitions

Component keys MUST match pattern: ^[a-zA-Z0-9._-]+$

Objects in components have no effect unless referenced.

{
"components": {
"schemas": {
"Money": {
"type": "object",
"properties": {
"amount": { "type": "string", "pattern": "^-?\\d+\\.\\d{2}$" },
"currency": { "type": "string", "pattern": "^[A-Z]{3}$" }
},
"required": ["amount", "currency"]
},
"OrderItem": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"quantity": { "type": "integer", "minimum": 1 }
},
"required": ["sku", "quantity"]
}
},
"errors": {
"CUSTOMER_NOT_FOUND": {
"code": "CUSTOMER_NOT_FOUND",
"message": "Customer not found",
},
"INSUFFICIENT_INVENTORY": {
"code": "INSUFFICIENT_INVENTORY",
"message": "Insufficient inventory",
"details": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"requested": { "type": "integer" },
"available": { "type": "integer" }
}
}
}
}
}
}

Enables reuse via JSON Reference.

FieldTypeRequired
$refstringYES

Reference paths follow JSON Pointer syntax:

  • #/components/schemas/Money — Local reference
  • common.json#/components/schemas/Money — External reference
{
"arguments": [
{
"name": "amount",
"schema": { "$ref": "#/components/schemas/Money" },
"required": true
}
]
}

Follows JSON Schema Draft-07.

Common patterns:

// String with pattern
{
"type": "string",
"pattern": "^[a-z0-9_]+$",
"minLength": 1,
"maxLength": 64
}
// Enum
{
"type": "string",
"enum": ["pending", "processing", "shipped"]
}
// Array
{
"type": "array",
"items": { "$ref": "#/components/schemas/OrderItem" },
"minItems": 1
}
// Object
{
"type": "object",
"properties": {
"name": { "type": "string" },
"email": { "type": "string", "format": "email" }
},
"required": ["name", "email"],
"additionalProperties": false
}

Services MUST implement urn:cline:forrst:fn:describe to return the Description Document.

Returns the complete description document or describes a specific function.

Parameters:

NameTypeRequiredDescription
functionstringNOSpecific function to describe
versionstringNOSpecific version (with function)

Result: Description Document Object (or subset for specific function)

Functions with discoverable: false are always excluded from the response.

// Request
{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_describe",
"call": {
"function": "urn:cline:forrst:fn:describe",
"version": "1.0.0",
"arguments": {}
}
}
// Response
{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_describe",
"result": {
"forrst": "0.1.0",
"describe": "0.1.0",
"info": {
"title": "Orders API",
"version": "2.3.0"
},
"functions": [
{ "name": "orders.get", "version": "2.0.0", ... },
{ "name": "orders.list", "version": "2.0.0", ... },
{ "name": "orders.create", "version": "2.0.0", ... }
],
"resources": {
"order": { ... },
"order_item": { ... }
},
"components": { ... }
}
}
// Request
{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_describe_fn",
"call": {
"function": "urn:cline:forrst:fn:describe",
"version": "1.0.0",
"arguments": {
"function": "orders.list",
"version": "2.0.0"
}
}
}
// Response
{
"protocol": { "name": "forrst", "version": "0.1.0" },
"id": "req_describe_fn",
"result": {
"name": "orders.list",
"version": "2.0.0",
"summary": "List orders",
"arguments": [...],
"result": {
"resource": "order",
"collection": true
},
"query": {
"filters": { "enabled": true, ... },
"sorts": { "enabled": true, ... },
"pagination": { "styles": ["cursor"], ... }
}
}
}

Custom extensions use fields prefixed with x-:

{
"name": "orders.create",
"version": "2.0.0",
"x-rate-limit": {
"requests": 100,
"window": { "value": 1, "unit": "minute" }
},
"x-owner": "orders-team"
}

Extensions MAY appear in any object. Tooling MAY ignore unknown extensions.


{
"forrst": "0.1.0",
"describe": "0.1.0",
"info": {
"title": "Orders API",
"version": "2.3.0",
"description": "Order management service for the e-commerce platform",
"contact": {
"name": "Platform Team",
"email": "platform@example.com"
}
},
"servers": [
{
"name": "production",
"url": "https://orders-api.internal"
}
],
"functions": [
{
"name": "orders.get",
"version": "2.0.0",
"summary": "Get an order by ID",
"tags": [{ "name": "orders" }],
"arguments": [
{
"name": "id",
"schema": { "type": "string" },
"required": true,
"description": "Order ID"
}
],
"result": {
"resource": "order",
"description": "The requested order"
},
"query": {
"fields": {
"enabled": true
},
"relationships": {
"enabled": true,
"available": ["customer", "items", "shipping_address"],
"max_depth": 2
}
},
"errors": [
{ "$ref": "#/components/errors/NotFound" }
],
"examples": [
{
"name": "Get order",
"arguments": { "id": "ord_xyz789" },
"result": {
"details": {
"type": "order",
"id": "ord_xyz789",
"attributes": {
"order_number": "ORD-2024-0001",
"status": "pending",
"total_amount": { "amount": "99.99", "currency": "USD" },
"created_at": "2024-01-15T10:30:00Z"
}
}
}
}
]
},
{
"name": "orders.list",
"version": "2.0.0",
"summary": "List orders",
"tags": [{ "name": "orders" }],
"arguments": [],
"result": {
"resource": "order",
"collection": true,
"description": "Paginated list of orders"
},
"query": {
"filters": {
"enabled": true,
"boolean_logic": true,
"resources": ["self", "customer"]
},
"sorts": {
"enabled": true,
"max_sorts": 2,
"default_sort": { "attribute": "created_at", "direction": "desc" }
},
"fields": {
"enabled": true,
"default_fields": {
"self": ["id", "order_number", "status", "total_amount", "created_at"]
}
},
"relationships": {
"enabled": true,
"available": ["customer", "items"],
"max_depth": 2
},
"pagination": {
"styles": ["cursor", "offset"],
"default_style": "cursor",
"default_limit": 25,
"max_limit": 100
}
}
},
{
"name": "orders.create",
"version": "2.0.0",
"summary": "Create a new order",
"tags": [{ "name": "orders" }],
"arguments": [
{
"name": "customer_id",
"schema": { "type": "string" },
"required": true
},
{
"name": "items",
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/OrderItemInput" },
"minItems": 1
},
"required": true
},
{
"name": "shipping_address_id",
"schema": { "type": "string" },
"required": false
}
],
"result": {
"resource": "order",
"description": "The created order"
},
"errors": [
{ "$ref": "#/components/errors/NotFound" },
{ "$ref": "#/components/errors/InvalidArguments" },
{ "$ref": "#/components/errors/InsufficientInventory" }
]
}
],
"resources": {
"order": {
"type": "order",
"description": "A customer order",
"attributes": {
"id": {
"schema": { "type": "string" },
"filterable": true,
"sortable": false,
"sparse": true
},
"order_number": {
"schema": { "type": "string" },
"filterable": true,
"filter_operators": ["equals", "like"],
"sortable": true
},
"status": {
"schema": {
"type": "string",
"enum": ["pending", "processing", "shipped", "delivered", "cancelled"]
},
"filterable": true,
"filter_operators": ["equals", "not_equals", "in"],
"sortable": true
},
"total_amount": {
"schema": { "$ref": "#/components/schemas/Money" },
"filterable": true,
"filter_operators": ["equals", "greater_than", "less_than", "between"],
"sortable": true
},
"item_count": {
"schema": { "type": "integer" },
"filterable": false,
"sortable": true
},
"created_at": {
"schema": { "type": "string", "format": "date-time" },
"filterable": true,
"filter_operators": ["equals", "greater_than", "less_than", "between"],
"sortable": true
},
"updated_at": {
"schema": { "type": "string", "format": "date-time" },
"filterable": true,
"filter_operators": ["greater_than", "less_than"],
"sortable": true
}
},
"relationships": {
"customer": {
"resource": "customer",
"cardinality": "one",
"filterable": true,
"includable": true
},
"items": {
"resource": "order_item",
"cardinality": "many",
"filterable": false,
"includable": true,
"nested": ["product"]
},
"shipping_address": {
"resource": "address",
"cardinality": "one",
"filterable": false,
"includable": true
}
}
},
"customer": {
"type": "customer",
"attributes": {
"id": { "schema": { "type": "string" }, "filterable": true },
"name": { "schema": { "type": "string" }, "filterable": true, "filter_operators": ["equals", "like"] },
"email": { "schema": { "type": "string", "format": "email" }, "filterable": true },
"type": {
"schema": { "type": "string", "enum": ["standard", "premium", "vip"] },
"filterable": true,
"filter_operators": ["equals", "in"]
}
}
}
},
"components": {
"schemas": {
"Money": {
"type": "object",
"properties": {
"amount": { "type": "string", "pattern": "^-?\\d+\\.\\d{2}$" },
"currency": { "type": "string", "pattern": "^[A-Z]{3}$" }
},
"required": ["amount", "currency"]
},
"OrderItemInput": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"quantity": { "type": "integer", "minimum": 1 }
},
"required": ["sku", "quantity"]
}
},
"errors": {
"NOT_FOUND": {
"code": "NOT_FOUND",
"message": "Resource not found",
},
"INVALID_ARGUMENTS": {
"code": "INVALID_ARGUMENTS",
"message": "Invalid arguments provided",
},
"INSUFFICIENT_INVENTORY": {
"code": "INSUFFICIENT_INVENTORY",
"message": "Insufficient inventory",
"details": {
"type": "object",
"properties": {
"sku": { "type": "string" },
"requested": { "type": "integer" },
"available": { "type": "integer" }
}
}
}
}
}
}

AspectStandard
FormatJSON (RFC 7159)
File nameforrst.json or forrst-describe.json
Case sensitivityAll field names are case-sensitive
Namingsnake_case for field names
Rich textGitHub Flavored Markdown
VersioningSemantic Versioning