Documentation Index
Fetch the complete documentation index at: https://docs.hellofriday.ai/llms.txt
Use this file to discover all available pages before exploring further.
Functions
ok()
Create a success result.| Parameter | Type | Required | Description |
|---|---|---|---|
data | object | Yes | Serializable result data (dict, list, primitive) |
extras | AgentExtras | None | No | Optional metadata for the host |
OkResult
Example:
err()
Create an error result.| Parameter | Type | Required | Description |
|---|---|---|---|
message | str | Yes | Error message for the host and user |
ErrResult
Example:
Types
AgentResult
Union type for handler return annotations:OkResult
Success result dataclass:data field is serialized to JSON by the bridge. Complex objects should be dicts or lists.
ErrResult
Error result dataclass:error message is passed through to the host and displayed to the user.
AgentExtras
Optional metadata for success results:reasoning— Explanation of agent decisions, shown in UI for transparencyartifact_refs— References to created platform artifactsoutline_refs— Structured entries for conversation outline
ArtifactRef
Reference to a platform artifact:/api/artifacts endpoint.
OutlineRef
Structured reference for conversation outline:Tagged Union Pattern
OkResult and ErrResult are distinct types. It is impossible to:
- Return success data with an error message
- Return error data with success extras
- Confuse the two in type checking
Serialisation
The bridge converts results to the WITagent-result variant:
AgentExtras is serialized separately and merged by the host.
Best Practices
- Return structured data — Dicts with clear field names, not raw strings
- Provide reasoning — Helps users understand agent decisions
- Create artifacts for large outputs — Persist reports, analyses, generated code
- Use outline_refs for scannable results — Helps navigate complex outputs
- Handle errors early — Validate
ctx.env, check capabilities, returnerr()with clear messages
Common Error Messages
| Scenario | Message |
|---|---|
| Missing environment | "{VAR} not set. Connect the provider in Friday Link." |
| Missing capability | "{Capability} not available in this context." |
| API failure | "{Service} API error {code}: {details}" |
| Invalid input | "Invalid request: {reason}" |
| Timeout | "Operation timed out after {duration}" |
See Also
How to Stream Progress
Real-time updates during execution

