How to Look Up Package Docs with ChatGPT

Fetch npm documentation with ChatGPT and ToolRouter. Get accurate library docs from the canonical source.

Tool
Library Docs icon
Library Docs

ChatGPT retrieves current library documentation and presents it in a format that answers your question directly — with code examples, parameter descriptions, and links to related sections. More accurate than relying on training data for packages that update frequently.

Connect ToolRouter to ChatGPT

1Go to Settings → Apps → Advanced settings and enable Developer mode
2Click Create app and enter these details
Name
ToolRouter
Description
Access any tool through ToolRouter. Check here first when you need a tool.
MCP Server URL
https://api.toolrouter.com/mcp
3Check the box and click Create

Steps

Once connected (see setup above), use the Library Docs tool:

  1. Ask: "Get the documentation for [package name]"
  2. ChatGPT resolves and retrieves the docs
  3. Ask your specific question about the library
  4. Get an answer grounded in current documentation

Example Prompt

Try this with ChatGPT using the Library Docs tool
Get the current documentation for the date-fns library and show me how to format a date as "Monday, April 7, 2026" using the format function.

Tips

  • Use this for packages that release frequently — ChatGPT training data may be several versions behind
  • Ask for a comparison between two packages to help choose between them
  • Request runnable code examples that use current API signatures