Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
endpointYes
methodYes
request_schemaYes
response_schemaYes
authNo
examplesNo
projectNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses side effects: creating a file, indexing, auto-push, and overwriting behavior. It also describes the return value (filename, chunk count, push status). Could have noted error handling, but still strong.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: purpose, side effects, usage, args, returns. It is front-loaded with the main action and every sentence serves a purpose, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 8 parameters, 5 required, and an output schema, the description covers all necessary details: parameter descriptions, side effects, usage guidance, and return values. It fully compensates for the lack of schema descriptions and annotations, making the tool self-contained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description compensates by explaining each parameter's meaning in the Args section (e.g., 'Short title', 'URL path', 'HTTP method'). This adds semantic value beyond the schema's type-only definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool creates, indexes, and pushes an API endpoint document to git. It explicitly differentiates from sibling tools write_architecture_doc and write_best_practice, leaving no ambiguity about its specific purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description specifies when to use (HTTP endpoints, REST APIs, RPC schemas) and contrasts with two sibling tools. It also mentions side effects like overwriting existing files, providing good context for appropriate usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dl4rce/flaiwheel'

If you have feedback or need assistance with the MCP directory API, please join our Discord server