Examples

Platform integration examples for an authorized workspace. Start with the connection guide; DDQ-only accounts do not have access to these platform tools.

Example 1 — Workspace briefing (Python)

This example calls the hosted HTTP endpoint with an existing, appropriately scoped OAuth access token. It prints the server's structured context instead of assuming that every workspace has the same enabled modules or records. Keep tokens and retrieved fund data in your authorized environment.

import json
import os
import httpx

FUNDOS_URL = "https://fundos.vantedgeai.com/mcp"
TOKEN = os.environ["FUNDOS_TOKEN"]
headers = {
    "Authorization": f"Bearer {TOKEN}",
    "Accept": "application/json, text/event-stream",
    "MCP-Protocol-Version": "2025-11-25",
}


def call_tool(name: str, args: dict) -> dict:
    response = httpx.post(
        FUNDOS_URL,
        headers=headers,
        json={
            "jsonrpc": "2.0",
            "method": "tools/call",
            "params": {"name": name, "arguments": args},
            "id": 1,
        },
        timeout=30,
    )
    response.raise_for_status()
    rpc = response.json()
    if "error" in rpc:
        raise RuntimeError("MCP request failed; inspect the authorized response")
    result = rpc["result"]
    if result.get("isError"):
        raise RuntimeError("Tool refused or failed; inspect the authorized response")
    # MCP wraps tool output in content blocks. A warning can precede the JSON.
    for block in result.get("content", []):
        if block.get("type") == "text":
            try:
                return json.loads(block["text"])
            except json.JSONDecodeError:
                continue
    raise RuntimeError("No JSON tool result was returned")


briefing = call_tool("fundos_get_agent_context", {
    "lookback_days": 1,
    "include_sections": ["pending_actions", "risk", "capital_calls"],
})
print(json.dumps(briefing, indent=2))

Example 2 — Webhook handler (Python / Flask)

A minimal Flask endpoint that receives FundOS webhook events, verifies the HMAC-SHA256 signature, and routes action.approval_required events to a Slack notification.

from flask import Flask, request, jsonify
import hmac
import hashlib
import requests  # pip install requests

app = Flask(__name__)
WEBHOOK_SECRET = "your-webhook-secret"   # from POST /api/v1/webhooks/ response
SLACK_WEBHOOK  = "https://hooks.slack.com/services/..."
FUNDOS_ORIGIN = "https://fundos.vantedgeai.com"


def verify_signature(raw_body: bytes, header: str, secret: str) -> bool:
    expected = "sha256=" + hmac.new(
        secret.encode(),
        raw_body,
        hashlib.sha256,
    ).hexdigest()
    return hmac.compare_digest(expected.encode(), header.encode())


@app.route("/fundos-webhook", methods=["POST"])
def handle_webhook():
    raw = request.get_data()
    sig = request.headers.get("X-FundOS-Signature", "")

    if not verify_signature(raw, sig, WEBHOOK_SECRET):
        return jsonify({"error": "invalid signature"}), 401

    event = request.json
    etype = event.get("event")

    if etype == "action.approval_required":
        action = event["data"]
        msg = (
            f":bell: *FundOS action needs approval*\n"
            f"Kind: `{action['kind']}`\n"
            f"Run: {action['run_id']}\n"
            f"Review: {FUNDOS_ORIGIN}/fundos/agent/runs/{action['run_id']}"
        )
        requests.post(SLACK_WEBHOOK, json={"text": msg})

    elif etype == "credit.low":
        d = event["data"]
        requests.post(SLACK_WEBHOOK, json={
            "text": f":warning: FundOS credit balance low: {d['balance']} credits remaining"
        })

    return jsonify({"received": True})

Example 3 — Claude Code session prompt

After following the connection guide and completing explicit OAuth consent, try this prompt in Claude Code. Its tools must be enabled for your workspace and granted scopes. This is an illustrative platform workflow, not evidence that every client or account can execute it.

Connect to FundOS MCP then:
1. Call fundos_get_agent_context — read the full briefing
2. Call fundos_list_risk_alerts — show me any open alerts
3. For any covenant approaching breach, call
   fundos_check_covenant with a stress test scenario
4. Summarise what needs my attention today and propose
   any actions for my approval
Review requirements: OAuth authorization, task processing consent and operation-specific human approvals are separate. A suggested action in an assistant's answer is not an approved or queued FundOS action. Follow the actual tool contract and server response before performing a mutation.

Next steps

Use the public agent guide for connection and capability discovery. The module reference describes provisioned platform workflows; the tool reference lists 80 catalog entries with parameters, tier and published base cost. Your authenticated catalog and agreement determine what is available to you.