Legal Document Analyzer Edge Function — Legal
LegalUpload contracts and ask questions. Scope queries to a specific document, extract named clause types in parallel (payment, termination, liability, etc.). Powered by llama-3.1-70b.
Edge function Legal Document Analyzer Upload contracts and ask questions. Scope queries to a specific document, extract named clause types in parallel (payment, termination, liability, etc.). Powered by llama-3.1-70b.. Deployed on Cloudflare Workers — zero cold starts, globally distributed. Mount it via your Aerostack workspace to call it from any AI agent.
npx aerostack add aerostack/legal-document-analyzer Use with AI Assistants
MCPConnect Claude, Cursor, or any MCP-compatible client — then call this function by slug
① Add MCP Server
Add this once — access all Aerostack functions from your AI tool.
{
"mcpServers": {
"aerostack": {
"url": "https://mcp.aerostack.dev",
"type": "http"
}
}
} ② Call this function
Ask your AI to use the call_function tool with this slug:
call_function({
slug: "legal-document-analyzer",
args: {}
}) Legal Document Analyzer
Upload contracts and analyze them with AI. Scope questions to specific documents and extract named clause types.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /ingest | Upload contract text or URL |
| POST | /analyze | Ask a question (optional document_id to scope) |
| POST | /extract | Extract named clause types in parallel |
| GET | /docs | List uploaded contracts |
| DELETE | /docs/:docId | Remove a contract |
| GET | /health | Status check |
All responses include a legal disclaimer. This does not constitute legal advice.
Metadata
Tags
Build and publish your own functions
Write a TypeScript function, deploy it to the edge, and share it with thousands of developers — in minutes.
Frequently asked questions
What does the Legal Document Analyzer function do? +
Legal Document Analyzer is a serverless edge function for legal automation written in cloudflare-worker. Deploy it to Cloudflare Workers via your Aerostack workspace.
How do I deploy the Legal Document Analyzer function? +
Install the Aerostack CLI and run: ```bash aerostack deploy function @aerostack/legal-document-analyzer ``` It will be live on Cloudflare Workers in seconds.
What runtime does Legal Document Analyzer use? +
Legal Document Analyzer runs on cloudflare-worker on the Cloudflare Workers edge runtime — zero cold starts, globally distributed.
Can I customise the Legal Document Analyzer function? +
Yes. Fork the function from your Aerostack dashboard, modify the source, and redeploy. All changes are version-controlled.