# AgentsTools Library Documentation Lookup

> AgentsTools Library Documentation Lookup is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-12).

Returns version-pinned package documentation (README or llms.txt section) plus identity metadata for npm, PyPI, crates.io, or GitHub packages, matched to an optional topic.

## Facts

- Endpoint: GET https://api.agentstools.dev/docs/library?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentstools-library-documentation-lookup-6e36f168
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_487oY-LJYxF3_PcxqOrAr

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentstools-library-documentation-lookup-6e36f168
```

Example prompt: Can you pull up the PyPI docs for the 'requests' library version 2.31.0, specifically the section on authentication?

## When to prefer this

Use this endpoint when a coding agent needs accurate, version-pinned library documentation without hallucination risk — especially when the agent needs to reference a specific API surface, authenticate usage, or verify a package's license and identity across npm, PyPI, crates.io, or GitHub without requiring an API key.

## Known failure modes

- Package not found in the specified ecosystem — returns 404 or empty result
- Version not found — requested pinned version does not exist in the version list
- Topic not matched — no heading in README/llms.txt matches the topic string, falls back to full README or returns empty section
- Unsupported ecosystem alias — unrecognized ecosystem string returns validation error
- Rate limit or payment failure — x402 payment not processed, returns 402

## How this service works

Up-to-date, version-pinned documentation for a library or API, for coding agents. Give an ecosystem and a package name (optional version and topic) and get a compact doc slice: package identity (latest and requested version, license, repo, homepage and doc URLs, version list) plus the README or llms.txt section matching the topic, each with a provenance citation. Keyless PyPI, npm, crates and GitHub sources.

## Output

A JSON object containing package identity fields (latest version, requested version, license, repo URL, homepage URL, docs URL, version list) plus the README or llms.txt markdown section matching the requested topic, each with a provenance citation indicating the source registry.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "name",
      "ecosystem"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "Package name; for github pass owner/repo such as coinbase/x402. npm scoped names @scope/name are allowed."
      },
      "topic": {
       "type": "string",
       "description": "Optional topic or symbol; matched against the README/llms.txt markdown headings, such as authentication or useEffect."
      },
      "version": {
       "type": "string",
       "description": "Optional exact version to pin, such as 2.31.0; default is latest."
      },
      "ecosystem": {
       "enum": [
        "npm",
        "pypi",
        "crates",
        "github"
       ],
       "type": "string",
       "description": "Package ecosystem. Aliases accepted: pip and python map to pypi; cargo and rust map to crates; node maps to npm; gh maps to github."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentstools-library-documentation-lookup-6e36f168/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
