write_api_doc
Document HTTP, REST, or RPC API endpoints by specifying URL, method, request/response schemas; automatically index and push to git.
Instructions
Create an API endpoint document, index it, and auto-push to git.
Side effects: creates api/{slug}.md in the docs path, indexes it into
the vector store, and pushes to git if configured. Overwrites an
existing file with the same title.
Use for HTTP endpoints, REST APIs, and RPC schemas.
Use write_architecture_doc() for system-level design decisions.
Use write_best_practice() for API coding conventions.
Args:
title: Short title (e.g. "Create User Endpoint")
endpoint: URL path (e.g. "/api/v1/users")
method: HTTP method: GET, POST, PUT, PATCH, DELETE, etc.
request_schema: Request body or query params description
response_schema: Response body schema and status codes
auth: Authentication/authorization requirements (optional)
examples: Curl or code examples (optional)
project: Target project name (optional)
Returns:
Saved filename, chunk count, and whether auto-push succeeded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auth | No | ||
| title | Yes | ||
| method | Yes | ||
| project | No | ||
| endpoint | Yes | ||
| examples | No | ||
| request_schema | Yes | ||
| response_schema | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |