Skip to content

feat: add get_node_help tool to retrieve node documentation#17

Open
woytekbode wants to merge 2 commits into
fx:mainfrom
woytekbode:feat/get-node-help
Open

feat: add get_node_help tool to retrieve node documentation#17
woytekbode wants to merge 2 commits into
fx:mainfrom
woytekbode:feat/get-node-help

Conversation

@woytekbode

Copy link
Copy Markdown

Adds a new get_node_help tool that fetches the HTML help/documentation for a specific node type via the Node-RED Admin API.

The Node-RED Admin API's GET /nodes/:module/:set endpoint returns HTML help content when requested with Accept: text/html. This is the same documentation shown in the Node-RED editor's info sidebar when selecting a node. This tool makes that documentation accessible to AI assistants, enabling them to understand node behavior, input/output formats, and configuration options.

Changes:

  • src/client.ts: Add getNodeHelp(module, set) method
  • src/tools/get-node-help.ts: New tool handler
  • src/server.ts: Register get_node_help tool
  • tests/client-runtime.test.ts: Add client method tests
  • tests/tools-runtime.test.ts: Add tool handler tests
  • tests/server.test.ts: Add tool to listing assertion
  • README.md: Document new tool in features list

Adds a new `get_node_help` tool that fetches the HTML help/documentation
for a specific node type via the Node-RED Admin API.

The Node-RED Admin API's GET /nodes/:module/:set endpoint returns HTML
help content when requested with Accept: text/html. This is the same
documentation shown in the Node-RED editor's info sidebar when selecting
a node. This tool makes that documentation accessible to AI assistants,
enabling them to understand node behavior, input/output formats, and
configuration options.

Changes:
- src/client.ts: Add getNodeHelp(module, set) method
- src/tools/get-node-help.ts: New tool handler
- src/server.ts: Register get_node_help tool
- tests/client-runtime.test.ts: Add client method tests
- tests/tools-runtime.test.ts: Add tool handler tests
- tests/server.test.ts: Add tool to listing assertion
- README.md: Document new tool in features list
Copilot AI review requested due to automatic review settings March 17, 2026 22:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new MCP tool, get_node_help, to fetch Node-RED node HTML documentation (the same content shown in the editor info sidebar) via the Node-RED Admin API.

Changes:

  • Add NodeRedClient.getNodeHelp(module, set) that requests GET /nodes/:module/:set with Accept: text/html.
  • Add a new tool handler src/tools/get-node-help.ts and register it in src/server.ts as get_node_help.
  • Add/adjust tests and update README feature list + examples.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/client.ts Adds getNodeHelp() client method that fetches HTML help from the Admin API.
src/tools/get-node-help.ts New tool handler that returns the HTML as MCP text content.
src/server.ts Registers the new get_node_help tool and routes calls to the handler.
tests/client-runtime.test.ts Adds tests for the new client method (success + error cases).
tests/tools-runtime.test.ts Adds tests for the new tool handler output.
tests/server.test.ts Updates tool listing assertion to include get_node_help.
README.md Updates tool count/features list and adds a usage example prompt.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tools/get-node-help.ts Outdated
Comment on lines +2 to +7

export async function getNodeHelp(
client: NodeRedClient,
args: { module: string; set: string }
) {
const result = await client.getNodeHelp(args.module, args.set);
Comment thread src/server.ts Outdated
case 'get_nodes':
return await getNodes(client);
case 'get_node_help':
return await getNodeHelp(client, request.params.arguments as { module: string; set: string });
Comment thread src/client.ts Outdated
Comment on lines +322 to +326
async getNodeHelp(module: string, set: string): Promise<string> {
const headers = this.getHeaders();
headers.Accept = 'text/html';
const response = await request(`${this.baseUrl}/nodes/${module}/${set}`, {
method: 'GET',
@woytekbode

Copy link
Copy Markdown
Author

Hi @fx. This is a lazy PR, straight from Claude via Github MCP. I'm not a true developer but I would like to use this MCP server to work on my Node Red home automation with Claude. However, from what I have seen, it appears Claude is unable to get node help docs, which would help properly set up new flows or edit existing flows/nodes. Therefore, I have decided to at least make clear my goals. Maybe this PR helps, maybe it does not. That's your call.

If you agree with the above, would you be willing to help me add a get-node-help function?

- Add Zod schema validation in get-node-help tool handler (args: unknown)
- Remove type assertion in server.ts switch case
- URL-encode module and set path segments with encodeURIComponent()
- Add test for scoped package URL encoding
- Add test for invalid argument rejection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants