Smolagents Tools for Brazil CVM Filings

Building Smolagents CVM filings agents? Expose apicvm as tools: resolve, list, download. Agents should cite document UUIDs. This is not a hosted Smolagents integration.

The problem

Lightweight agent loops that research Brazilian issuers need primary filings over HTTP, not blog summaries or brittle portal scrapers.

Solution flow

tool(list) → tool(download) → optional async extract → cite UUID

Tool sketch

import os, requests

BASE = os.environ["APICVM_URL"]
H = {"Authorization": f"Bearer {os.environ['APICVM_KEY']}"}

def list_cvm_filings(ticker: str, doc_type: str = "DFP", year: int = 2024) -> str:
    r = requests.get(
        f"{BASE}/v1/documents",
        headers=H,
        params={"ticker": ticker, "type": doc_type, "year": year, "perPage": 20},
        timeout=60,
    )
    r.raise_for_status()
    return "\n".join(f"{d['id']}\t{d['name']}" for d in r.json()["data"])

Register list_cvm_filings as a Smolagents tool; keep rate limits in mind across parallel agents.

Current limitations

  • No push notifications for new filings; agents must re-list
  • Extraction is async via callback (Pro)
  • Empty lists can be corpus gaps

Next steps

Ready to integrate?

Get an API key and start querying Brazilian CVM filings programmatically.