Skip to content

API reference

Generated from the docstrings in the code. The concepts and guides explain how the pieces fit together; these pages list every public class and function.

  • Server and tools: OunceServer, ToolContext, effects, results and pagination.
  • Budgets and token counting: Budget, BudgetOverride, tokenizers and cost reports.
  • Errors: the error classes a tool can raise.
  • Execution: stores, idempotency, approvals, retries, limits and jobs.
  • Security: identity, policies, cached data, state tokens and safe fetches.
  • Clients: the broker and OAuth.
  • Traces: the tracer, its sinks and redaction.
  • Evaluation: task suites, models, reports and the benchmark.
  • Testing helpers: as_caller and make_token.

Names exported from ouncemcp, ouncemcp.security, ouncemcp.client, ouncemcp.trace, ouncemcp.eval, ouncemcp.eval.agent, ouncemcp.testing and ouncemcp.ui are the public API; tests/test_api_surface.py fails if any of them changes by accident. Anything else may change before 1.0. The plan for freezing it is proposal 0029.