ctx.capabilities
ctx.capabilities exposes the final model capability flags resolved for the current turn.
Overview
ctx.capabilities contains the final capability flags for the model selected on the current turn.
These flags describe what the active model is able to do so strategies can adjust their behavior accordingly.
Shape
interface Capabilities {
vision: boolean
structuredOutput: boolean
tools: boolean
}Fields
The runtime currently exposes:
visionstructuredOutputtools
Field Meanings
vision
Indicates whether the current model supports image understanding.
When vision is true, strategies may include image attachments in prompts and expect the model to process them.
structuredOutput
Indicates whether the model supports structured output constraints such as JSON schema enforcement.
When enabled, strategies may rely on structured response formats instead of prompt-based JSON instructions.
tools
Indicates whether the model supports tool/function calling.
When true, strategies may register tools and allow the model to invoke them during generation.
Source of Truth
Capability values are resolved by the host from the selected model configuration.
Strategies should treat these flags as read-only indicators of the model’s available features.
Usage
Strategies may branch behavior based on the active model capabilities:
if (ctx.capabilities.vision) {
// include image attachments
}
if (ctx.capabilities.tools) {
// enable tool usage
}