> ## 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.

# Overview

> Write Friday agents in Python using the friday-agent-sdk package.

Write agents in Python - the Friday platform handles the rest. Your agent runs as a Python subprocess with access to LLMs, HTTP, and MCP tools through the `ctx` interface.

## How it works

Your agent is a Python function with two inputs and one output:

```python theme={null}
def execute(prompt: str, ctx: AgentContext) -> Result:
    # prompt: what the job FSM passed as input
    # ctx:    bridges to Friday's capabilities (LLMs, HTTP, MCP tools)
    # Result: structured data back to the platform
```

The `@agent` decorator registers your function with Friday. Call `run()` in the `__main__` block - that's how the subprocess connects to the daemon.

## Quick example

```python agent.py theme={null}
from friday_agent_sdk import agent, ok, AgentContext, run

@agent(
    id="my-agent",
    version="1.0.0",
    description="Summarizes text with an LLM",
)
def execute(prompt: str, ctx: AgentContext):
    result = ctx.llm.generate(
        messages=[{"role": "user", "content": f"Summarize this: {prompt}"}],
        model="anthropic:claude-haiku-4-5",
    )
    return ok({"summary": result.text})

if __name__ == "__main__":
    run()
```

The `@agent` decorator registers metadata. Host capabilities on `ctx` handle LLM calls, HTTP requests, MCP tools, and streaming. `ok()` returns structured data to the platform.

## Development setup

Install the SDK locally for IDE support. The SDK is a Python package - Friday runs your agent as a subprocess, but you need the package locally for autocomplete and type checking.

**1. Clone the SDK repository:**

```bash theme={null}
git clone git@github.com:friday-platform/agent-sdk.git ~/agent-sdk
```

**2. Create a virtual environment and install the SDK:**

```bash theme={null}
cd my-agent-project
uv venv
source .venv/bin/activate  # or: .venv\Scripts\activate on Windows
uv pip install -e ~/agent-sdk/packages/python
```

**3. Configure VS Code:**

Create `.vscode/settings.json` in your agent project:

```json theme={null}
{
  "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
  "python.analysis.typeCheckingMode": "basic",
  "[python]": {
    "editor.defaultFormatter": "charliermarsh.ruff",
    "editor.formatOnSave": true
  }
}
```

Install the [Ruff extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) for linting and formatting. Reload VS Code after creating the settings.

**Verify:** Open any `.py` file and check that `from friday_agent_sdk import agent` shows no import errors.

<Tip>
  **Let an agent write your agent.** The
  [`writing-friday-python-agents`](https://github.com/friday-platform/agent-sdk/tree/main/packages/python/skills/writing-friday-python-agents)
  skill works in Claude Code and other coding agents. It covers the full
  SDK, so agents you generate register cleanly the first time.
</Tip>

## Prerequisites

* Python 3.11+ (for IDE support and local testing)
* A running Friday daemon (`friday daemon status`)
* An Anthropic API key

## Get started

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/sdk/quickstart">
    Build a text analysis agent from scratch in under 10 minutes.
  </Card>

  <Card title="How agents work" icon="microchip" href="/sdk/how-agents-work">
    The subprocess model, host capabilities, and registration.
  </Card>
</CardGroup>

## Guides

<CardGroup cols={3}>
  <Card title="Call LLMs" icon="brain" href="/sdk/guides/call-llms">
    Models, structured output, error handling.
  </Card>

  <Card title="HTTP requests" icon="globe" href="/sdk/guides/make-http-requests">
    External API calls through the fetch layer.
  </Card>

  <Card title="MCP tools" icon="wrench" href="/sdk/guides/use-mcp-tools">
    GitHub, databases, and other MCP servers.
  </Card>

  <Card title="Structured input" icon="brackets-curly" href="/sdk/guides/handle-structured-input">
    Parse JSON from enriched prompts.
  </Card>

  <Card title="Stream progress" icon="bars-progress" href="/sdk/guides/stream-progress">
    Real-time UI updates during execution.
  </Card>
</CardGroup>

## Reference

<CardGroup cols={2}>
  <Card title="@agent decorator" href="/sdk/python-reference/agent-decorator">
    Metadata, environment, MCP, and LLM configuration.
  </Card>

  <Card title="AgentContext" href="/sdk/python-reference/agent-context">
    Execution context and capability availability.
  </Card>

  <Card title="ctx.llm" href="/sdk/python-reference/llm-capability">
    LLM generation methods and response types.
  </Card>

  <Card title="ctx.http" href="/sdk/python-reference/http-capability">
    HTTP fetch and response handling.
  </Card>

  <Card title="ctx.tools" href="/sdk/python-reference/tools-capability">
    MCP tool listing and invocation.
  </Card>

  <Card title="ctx.stream" href="/sdk/python-reference/stream-capability">
    Progress and intent emission.
  </Card>

  <Card title="Result types" href="/sdk/python-reference/result-types">
    ok(), err(), and AgentExtras.
  </Card>

  <Card title="Parse utilities" href="/sdk/python-reference/parse-utilities">
    parse\_input() and parse\_operation().
  </Card>
</CardGroup>
