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.
Definition
tools, llm, http, stream) are always non-None. They default to safe stubs that raise RuntimeError if called outside the host environment.
Fields
env
- Type:
dict[str, str] - Description: Environment variables configured via the
@agentdecorator’senvironmentfield.
environment.required and environment.optional configuration.
config
- Type:
dict - Description: Agent-specific configuration and workspace context.
platformUrl— Friday API base URLskills— List of workspace skills for the sessionworkDir— Existing workspace directory (if FSM set one up)- Custom fields passed by the orchestrator
session
- Type:
SessionData | None - Description: Session metadata when running within a Friday session.
None in test contexts or standalone execution.
output_schema
- Type:
dict | None - Description: JSON Schema for structured output, if specified by the caller.
tools
- Type:
Tools - Description: MCP tool capability wrapper. Always available — returns empty list when no MCP servers configured.
ctx.tools.list()→list[ToolDefinition]ctx.tools.call(name, args)→dict
llm
- Type:
Llm - Description: LLM capability wrapper for generation calls. Always available in host environment.
ctx.llm.generate(messages, model, ...)→LlmResponsectx.llm.generate_object(messages, schema, ...)→LlmResponse
http
- Type:
Http - Description: HTTP capability wrapper for outbound requests. Always available in host environment.
ctx.http.fetch(url, method, headers, body, timeout_ms)→HttpResponse
stream
- Type:
StreamEmitter - Description: Stream capability for progress emission. Always available in host environment.
ctx.stream.progress(content, tool_name)ctx.stream.intent(content)ctx.stream.emit(event_type, data)
Availability Guarantees
| Field | Guaranteed | Notes |
|---|---|---|
env | Yes | Empty dict if no environment configured |
config | Yes | Empty dict if no config provided |
session | No | May be None outside Friday sessions |
output_schema | No | Only when caller specifies schema |
tools | Yes | Always present; returns empty list if no MCP servers |
llm | Yes | Always present; raises RuntimeError if not initialized |
http | Yes | Always present; raises RuntimeError if not initialized |
stream | Yes | Always present; safe no-op in test contexts |
Defensive Programming
RuntimeError with a clear message. To test agents properly, mock the capabilities or run within the conformance test suite.
Context Round-Trip
All context fields are serialized over NATS for each invocation:- Friday serializes context as JSON
- JSON is sent to the agent subprocess via NATS
- SDK bridge deserializes to
AgentContextdataclass - Your code uses the context
- Result serializes back to the host
context-inspector example agent demonstrates all fields survive this round-trip correctly.
See Also
ctx.llm
LLM generation
ctx.http
HTTP requests
ctx.tools
MCP tool calls
ctx.stream
Progress streaming
Result Types
ok() and err() return values

