write_api_doc
Document an HTTP or RPC endpoint by specifying method, path, request/response schemas, and optional auth examples. The tool saves the file, indexes it, and auto-pushes 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 |
|---|---|---|---|
| title | Yes | ||
| endpoint | Yes | ||
| method | Yes | ||
| request_schema | Yes | ||
| response_schema | Yes | ||
| auth | No | ||
| examples | No | ||
| project | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |