# npm Symbol Context Lookup

> npm Symbol Context Lookup is a paid API for AI agents from x402-canary.nicolas-x402-16f380a7.workers.dev, paid per call via x402, $0.015/call, status unknown (last checked 2026-09-15).

Returns TypeScript API signatures and type definitions for specified symbols from an npm package, resolved from the package's distributed type declaration files.

## Facts

- Endpoint: POST https://x402-canary.nicolas-x402-16f380a7.workers.dev/v1/agent/npm-symbol-context
- Price: $0.015/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/npm-symbol-context-lookup-cdba7a23
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EuUfB88N2cc90ROjCLpiN

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 npm-symbol-context-lookup-cdba7a23 -d '<json body>'
```

Example prompt: Can you look up the TypeScript type signature for the Hono class in the hono package, version 4.13.2?

## When to prefer this

Choose this endpoint when a coding agent or developer tool needs precise, machine-readable TypeScript type declarations for specific symbols from an npm package — especially when the exact constructor signature, method signatures, or exported interface shape is needed at a specific version. Prefer this over full documentation scrapers when you only need targeted symbol-level type information rather than prose documentation.

## Known failure modes

- Package not found on npm — returns empty symbol_hits or error
- Symbol not exported by the package — returns empty snippet for that symbol
- Version string doesn't resolve to a valid published version — may fall back to latest or return error
- Too many symbols requested (max 8) — request rejected
- Package name too long (max 214 chars) — request rejected
- Payment not completed via x402 — 402 Payment Required response before data is returned

## How this service works

Free need-to-tool routing plus pay-per-call npm docs and TypeScript API signatures, npm breaking-change diffs, JavaScript-rendered browser snapshots and deterministic coding-agent checks via AgentCash/x402.

## Output

A JSON object containing the package name, a list of symbol hits (each with the source .d.ts file path and the relevant TypeScript declaration snippet), the resolved package version, the latest available version, and the list of requested symbols. The engine metadata field identifies the service as 'npm-symbol-context'.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "package": {
   "type": "string",
   "example": "hono",
   "maxLength": 214
  },
  "symbols": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "example": [
    "Hono"
   ],
   "maxItems": 8
  },
  "version": {
   "type": "string",
   "example": "4.13.2",
   "maxLength": 100
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "package": "hono",
   "symbol_hits": [
    {
     "file": "package/dist/types/hono.d.ts",
     "symbol": "Hono",
     "snippet": "export declare class Hono..."
    }
   ],
   "latest_version": "4.13.2",
   "resolved_version": "4.13.2",
   "requested_symbols": [
    "Hono"
   ]
  },
  "meta": {
   "engine": "npm-symbol-context"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/npm-symbol-context-lookup-cdba7a23/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-canary.nicolas-x402-16f380a7.workers.dev](https://www.zero.xyz/host/x402-canary.nicolas-x402-16f380a7.workers.dev/llms.txt)
