Context Schema

Schema for OCP context objects carried in the OCP-Session header.

JSON Schema: /schemas/ocp-context.json

Properties

FieldTypeRequiredDescription
agent_typestringYesType of agent creating this context
context_idstringYesUnique identifier for this context
created_atstringYesWhen this context was first created
last_updatedstringYesWhen this context was last modified
api_specsobjectNoAPI specifications for enhanced responses
context_summarystring?NoBrief summary of conversation context
current_filestring?NoCurrently active file
current_goalstring?NoAgent’s current objective
error_contextstring?NoError information for debugging
historyarrayNoChronological record of actions and API calls
recent_changesarrayNoRecent changes or modifications (max 10)
sessionobjectNoSession tracking information for this context
userstring?NoUser identifier
workspacestring?NoCurrent workspace or project

context_id

Type: string

Unique identifier for this context

Pattern: ^ocp-[a-f0-9]{8,}$

recent_changes

Type: array

Recent changes or modifications (max 10)

Default: []

session

Type: object

Session tracking information for this context

Properties

FieldTypeRequiredDescription
agent_typestringYesType of agent for this session
interaction_countintegerYesNumber of interactions in this session
start_timestringYesSession start timestamp

session.start_time

Type: string

Session start timestamp

Format: date-time

session.interaction_count

Type: integer

Number of interactions in this session

Minimum: 0

Default: 0

history

Type: array

Chronological record of actions and API calls

Array items: object

Item Properties:

Properties

FieldTypeRequiredDescription
actionstringYesType of action performed
timestampstringYesWhen this action occurred
api_endpointstring?NoAPI endpoint called if applicable
metadataobjectNoAdditional contextual data for this action
resultstring?NoSummary of action result

history.timestamp

Type: string

When this action occurred

Format: date-time

history.metadata

Type: object

Additional contextual data for this action

Default: {}

api_specs

Type: object

API specifications for enhanced responses

api_specs.parameters_pattern

Type: object (dynamic properties)

Pattern: Properties matching ^[a-zA-Z0-9_-]+$

Each property matching this pattern must be:

  • Type: string

created_at

Type: string

When this context was first created

Format: date-time

last_updated

Type: string

When this context was last modified

Format: date-time