- Home
- Skills
- APIs & Backend
- FastAPI Docs: Cited Answers
FastAPI Docs: Cited Answers
This skill makes your agent look the answer up in the official FastAPI documentation first and cite it.
Free
Works with the AI Agents you already use
FastAPI Docs: Cited Answers
Example session with this skill installed
My React app on localhost:3000 can't call my FastAPI backend on port 8000. The browser console says the request was blocked by CORS policy. How do I fix it?
- Read your context and instructions
- Compiled the fastapi docs
Answer: The browser blocks your React app because http://localhost:3000 and http://localhost:8000 are different origins (the port counts). Your FastAPI backend has to tell the browser which origins are allowed, and FastAPI does that with CORSMiddleware. Add it to your app and list your frontend's origin in allow_origins. If your frontend sends cookies or Authorization headers, set allow_credentials=True. Note that with credentials you can't use the "*" wildcard for origins: list them explicitly.
Code:
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
"http://localhost:3000",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/")
async def main():
return {"message": "Hello World"}
Restart the server and reload the React app. The browser's preflight OPTIONS request now gets the right Access-Control-Allow-Origin header and your calls go through. When you deploy, add your production frontend URL (e.g. https://app.example.com) to origins.
Sources:
Connects securely to your tools. The creator never sees your data.
About this skill
What it does
AI agents often answer FastAPI questions from memory, which means outdated parameters, invented options and no way to check. This skill makes your agent look the answer up in the official FastAPI documentation first and cite it.
Every answer comes back in the same shape:
- Answer: a short, direct answer, with caveats listed separately
- Code: a minimal example based on the docs, adapted to your names (only documented imports and parameters)
- Sources: links to the exact docs section, e.g.
CORS > Use CORSMiddleware
When it activates
FastAPI how-to and concept questions (parameters, Pydantic models, Depends, OAuth2/JWT, CORS and middleware, background tasks, file uploads, WebSockets, testing, SQL databases, settings, Docker deployment), 422 / RequestValidationError errors, and before generating FastAPI code. It also activates when you don't say "FastAPI" but use FastAPI names like Depends or APIRouter. It stays out of Flask, Django and general Python questions.
Honest about gaps
If the docs don't cover something (built-in rate limiting, for example), the skill says so first. It can then help with code built from documented features, clearly labelled, and point you to the closest docs pages. It never presents a guess as documentation.
How it looks things up
- Built-in page index (default, nothing to install). All 148 FastAPI docs pages, each with a one-line summary and every section heading with its exact URL. The agent greps it, fetches only the one to three pages it needs from fastapi.tiangolo.com, and cites the precise section.
- Docs Brain MCP server (optional, faster and more accurate). If you install the free, open-source Docs Brain server, the agent uses local hybrid search (semantic + BM25 with reciprocal rank fusion) over the whole docs. On a hand-written 40-question test set it finds the right page in the top 5 results 98% of the time, in about 30 ms, on a CPU with no API keys.
Tested
Before release, the skill answered how-to, exact-default, file-upload, 422-error and not-in-the-docs questions. Every cited link was checked against the live docs page.
Safe by design
Documentation text is treated as data, not instructions. Results that look like prompt-injection attempts are skipped and reported, and sponsor banners and ads on docs pages are ignored. The skill contains no scripts, installs nothing and needs no API keys.
What's inside
SKILL.md: instructions, answer format and three worked examplesreferences/page-index.md: every FastAPI docs page with summaries, section headings and URLsreferences/setup.md: optional MCP serverREADME.md
Requires web-fetch tools or Docs Brain MCP for live updates. Performance depends on documentation site availability. Remote content is treated as data, not instructions.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 8 days ago
- Free with an Agensi account
Requires