[PR #3613] [CLOSED] docs(agents): add warning for JS runtime tool registration limitation #3652

Closed
opened 2026-06-05 18:23:48 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/3613
Author: @sasmita016
Created: 4/17/2026
Status: Closed

Base: mainHead: fix/js-runtime-tool-registration-limitation


📝 Commits (1)

  • c85a313 docs(agents): add warning for JS runtime tool registration limitation

📊 Changes

1 file changed (+14 additions, -1 deletions)

View changed files

📝 src/oss/langchain/agents.mdx (+14 -1)

📄 Description

Problem

The "Runtime tool registration" tab in the agents docs shows a JS/TS
example using wrapModelCall to add new tools at runtime. This throws:

Error: You have added a new tool in "wrapModelCall" hook of middleware "...".
This is not supported.

Reproduced in @langchain/core@1.2.26 and @langchain/langgraph@^1.0.14.
The Python version works via AgentMiddleware. The JS version does not.

Fix

Added a callout in the JS tab explaining the limitation and
pointing users to the working "Filtering pre-registered tools" approach.

References


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/3613 **Author:** [@sasmita016](https://github.com/sasmita016) **Created:** 4/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/js-runtime-tool-registration-limitation` --- ### 📝 Commits (1) - [`c85a313`](https://github.com/langchain-ai/docs/commit/c85a313a104a9e842261d3976d605f12ad646d54) docs(agents): add warning for JS runtime tool registration limitation ### 📊 Changes **1 file changed** (+14 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/agents.mdx` (+14 -1) </details> ### 📄 Description ## Problem The "Runtime tool registration" tab in the agents docs shows a JS/TS example using wrapModelCall to add new tools at runtime. This throws: Error: You have added a new tool in "wrapModelCall" hook of middleware "...". This is not supported. Reproduced in @langchain/core@1.2.26 and @langchain/langgraph@^1.0.14. The Python version works via AgentMiddleware. The JS version does not. ## Fix Added a <Warning> callout in the JS tab explaining the limitation and pointing users to the working "Filtering pre-registered tools" approach. ## References - langchain-ai/langgraphjs#1934 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 18:23:48 -04:00
yindo closed this issue 2026-06-05 18:23:48 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#3652