Nodes/ERPK Collection/Claude Tool Definition
ComfyUI Node

Claude Tool Definition

Hand Claude a schema without writing one

By eRepublik-Labs·Created 11 months ago·Updated 21 days ago· 1
Claude Tool Definition
  • previous_tools
  • tools
tool_name
description
parameters_json{ "type": "object", "properties": {}, "required": [] }

If you've read the Claude Structured Output article, you already know the payoff: force Claude into a tool call and you get clean JSON instead of prose. This node is where the tool definition comes from. It builds an Anthropic tool schema from three text fields and hands it out as a CLAUDE_TOOLS value you can chain - so one definition feeds Structured Output, and several definitions can stack together before a single call.

You don't need to know the Anthropic API shape to use it. You fill in three boxes and it assembles the JSON under the hood.

The three fields that matter

  • tool_name - the snake_case identifier, e.g. extract_person. This is what the API (and your Structured Output node) uses to route the call.
  • description - what the tool does, in plain words. This is shown to the model, so it's the most influential field: "Extract the person's name, age, and a one-sentence biography" beats "get info" every time.
  • parameters_json - a JSON Schema for the tool's inputs. The default is a valid empty object schema:
    {
      "type": "object",
      "properties": {},
      "required": []
    }
    Add your own properties and required arrays. This is the one field where you do touch raw JSON - there's no visual builder, so paste carefully.

The previous_tools input is the chaining hook: wire another Tool Definition's tools output into it and this node appends its tool to the list. That's how you build a multi-tool definition for a single Claude call.

Output

One output, tools (type CLAUDE_TOOLS). Wire it into Claude Structured Output's tool input (which insists on exactly one tool) or feed a multi-tool stack into Claude Text Generation if the API client supports tool use.

Install notes

Part of the ERPK Collection. ComfyUI Manager → search erpkERPK Custom Nodes, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk && pip install -r requirements.txt

Restart, add an Anthropic key under Settings > ERPK > API Keys if you haven't. No model downloads - this node doesn't even call the API itself; it just manufactures the schema payload.

The traps are JSON-shaped: a trailing comma or a missing quote in parameters_json and Structured Output fails downstream with a parse error that names this node's output. Validate your schema in an editor before pasting. And don't fight the snake_case convention - tool names with spaces or capitals are a reliable way to confuse the model's routing.

CategoryERPK/Claude/Tools

Inputs (4)

NameTypeDefaultDescription
tool_nameSTRINGsnake_case tool identifier (e.g. extract_person)
descriptionSTRINGWhat this tool does — shown to the model
parameters_jsonSTRING{ "type": "object", "properties": {}, "required": [] }JSON Schema for the tool's input parameters
previous_toolsoptCLAUDE_TOOLSChain from another Tool Definition node

Outputs (1)

NameTypeDescription
toolsCLAUDE_TOOLS