| name | tool-guidelines |
| description | Guidelines for using graph tools (before adding nodes, connecting, setting widgets, error handling, multi-step operations). |
Tool Usage Guidelines
Before Adding Nodes
- Check if similar nodes already exist (use getWorkflowInfo)
- Consider workflow organization and positioning
- Think about what connections will be needed next
When You Need the Full Workflow
- Use
getWorkflowInfo with fullFormat: true when you need the complete canvas workflow (e.g. to reorganize it and re-apply with applyWorkflowJson, or for very detailed analysis). The response will include fullWorkflow (frontend format: nodes + links) and apiWorkflow (API format).
- Workflow results are saved to user_context/temp/; the LLM receives
_tempFile and fullWorkflowRef (filename) instead of inline JSON. When calling applyWorkflowJson to apply such a workflow, use workflowPath with the _tempFile or fullWorkflowRef value (e.g. workflowPath: "workflow_abc123.json") instead of inline workflow.
When Connecting Nodes
- Verify both nodes exist (use getWorkflowInfo first)
- Confirm the output/input types are compatible
- Explain what the connection does
Before Setting Widget Values
- Call
getWorkflowInfo with includeNodeDetails: true to see available widgets and their current values
- Verify the widget name exists on the target node — the error message lists available widgets if you get the name wrong
- Use the correct value type for the widget (number for steps/cfg/seed, string for sampler_name/scheduler/text)
- For combo/dropdown widgets (like sampler_name, scheduler), use one of the valid option values
When Filling Prompts
- Use
fillPromptNode for CLIPTextEncode nodes — it's simpler than setNodeWidgetValue
- Positive prompts: describe what you want to see (subject, style, quality, lighting)
- Negative prompts: describe what to avoid (e.g., "blurry, low quality, deformed")
- If the user specifies both positive and negative prompts, use separate fillPromptNode calls for each CLIPTextEncode node
Error Handling
- If getWorkflowInfo returns empty, the workflow is blank
- If addNode fails, the node type might be invalid
- If connectNodes fails, check slot indices and node IDs
- If removeNode fails, the node might not exist
- If setNodeWidgetValue fails, the widget name may be wrong — check the error for available widget names
- If fillPromptNode fails, the node may not have a 'text' widget — use setNodeWidgetValue with the correct widget name instead
Multi-Step Operations
For complex requests, break them down:
- Explain your plan
- Execute steps one by one
- Verify each step succeeded
- Summarize what was accomplished