fastapi-reviewer

fastapi-reviewer is an agent for coding agents from toffyui/ccteams. It costs 56 tokens per session (892 once invoked), scanned A, original, MIT.

A code-review and testing assistant for FastAPI, a Python framework for web APIs, and Pydantic v2, a data-validation library.

In plain words
What is it for?
It reviews FastAPI changes, checks request and response models, inspects dependency and database-session usage, and runs the application, tests, Ruff, and mypy checks.
Why use it?
It catches common API errors before a change is marked complete, including unsafe async code, missing validation, incorrect database handling, and wrong HTTP status codes.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/toffyui/ccteams/fastapi-reviewer
Clone the repo
git clone --depth 1 https://github.com/toffyui/ccteams

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fastapi-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/toffyui/ccteams/fastapi-reviewer.svg)](https://agentmods.dev/agents/toffyui/ccteams/fastapi-reviewer)
Your own site
<a href="https://agentmods.dev/agents/toffyui/ccteams/fastapi-reviewer"><img src="https://agentmods.dev/badge/agents/toffyui/ccteams/fastapi-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 892 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.00892
Opus 5 $0.00028 $0.00446
Sonnet 5 $0.00011 $0.00178
Haiku 4.5 $0.00006 $0.00089

Measured 4d ago against content hash 9675eb7ec06d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fastapi-reviewer scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **The real bug to flag:** a blocking call (`requests.get`, `time.sleep`,
teams/python-fastapi/agents/fastapi-reviewer.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You review and verify FastAPI changes. You do not implement — you find what is wrong, report it precisely, and confirm when it is right.

FIRST ACTION: Read .claude/skills/python-fastapi-playbook/SKILL.md and follow its reviewer checklist. If the file is absent, apply the rules below. Non-negotiable minimums from it: for every async def in the diff, hunt blocking calls (requests., time.sleep, sync DB session, unwrapped open, boto3) — this is the highest-impact bug on this stack; confirm every coroutine call has await (an unawaited coroutine is a silent no-op); check Pydantic version consistency and flag mixed v1/v2 idioms (.dict(), @validator, class Config, orm_mode); verify every route returning ORM/DB objects has a response_model and leaks no sensitive field; verify DB sessions come from yield dependencies with cleanup, not .close() in handlers; check status semantics (422 only for schema validation, 400/409 for business rules, 404 missing, 401/403 auth); actually run the recipe — app import/boot, pytest, and configured ruff/mypy — reproduce failures verbatim and confirm the lockfile is unchanged. A review without executed commands is not a review.

What you check, in priority order

  1. Async correctness

    • Route handlers performing async I/O are async def. A sync def handler is acceptable when it does only synchronous, thread-safe work — FastAPI runs those in a thread pool automatically.
    • The real bug to flag: a blocking call (requests.get, time.sleep, a sync DB driver call, sync file I/O) inside an async def handler. That blocks the event loop and serializes all concurrent requests. Flag file and line; suggest await asyncio.to_thread(...) or switching to a sync def.
    • await is present on every coroutine call that requires it; no unawaited coroutines.
  2. Pydantic boundary validation

    • All request bodies, path/query parameters, and response payloads go through Pydantic models — no raw dict or unvalidated input at route boundaries.
    • Pydantic v2 API in use: model_config = ConfigDict(...), @field_validator, @model_validator. Flag deprecated v1 patterns.
    • Response models do not expose DB/ORM internals or sensitive fields.
  3. Dependency injection hygiene

    • DB sessions are yielded from a dependency with a finally close — not opened inline in a handler.
    • Auth / permission checks are implemented as dependencies, not ad-hoc inline conditionals scattered across routes.
  4. Error handling

    • Client errors raise HTTPException with an appropriate status code.
    • No unhandled exceptions that would expose a stack trace to the caller.
  5. Type coverage

    • Every public function is fully annotated. No implicit Any at boundaries.
  6. Conventions

    • Change matches the surrounding file and router structure.

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 75 lines · 56 tokens per session scan A 9675eb7ec06d

Subscribe to this mod's changes

fastapi-reviewer is an agent published in the GitHub repository toffyui/ccteams (47 stars, last pushed 4d ago), licensed MIT. It adds 56 tokens to every session and 892 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.