Debug a Plugin
When a plugin returns an error or the wrong result, attach it to a ToolSmith chat and describe the problem. ToolSmith reads the plugin’s execution logs, names the likely cause, and proposes a fix as a plan. Nothing changes until you approve the plan.
ToolSmith can debug any plugin, including one built by hand in Tool Studio. It does not watch for failures, so start a chat when you or a user finds one.
The examples on this page come from a plugin that lists open ServiceNow incidents, broken on purpose by changing one action’s table name to one that does not exist. ServiceNow rejects the request with HTTP 400, so the plugin fails when an employee asks, “Show my open incidents.”
Problems ToolSmith can investigate
Describe the problem as you see it. You do not need to know the cause.
Find and fix the cause
ToolSmith publishes the assets it changes, so a fix reaches everyone who uses the plugin before you test it. When you can, debug in a non-production environment, then move the plugin to production with Plugin Promotion.
Attach the plugin to a new chat
Start a new ToolSmith chat, select + in the message box, and search for the plugin in the Search plugins… box. You can attach plugins only, so if you suspect an action, attach a plugin that uses it.
Describe the problem
A short report works, such as “This plugin is broken. Figure out why and fix it.” You can also paste a user’s report as they sent it. Details that help:
- The exact request that failed
- What the plugin answered
- What you expected, or what the external system holds
- The exact error message
The example uses this report:
Check the cause and the plan
Check that the cause matches what you saw, such as the error message or the missing records. If it does not, select Modify plan and say what does not fit.
In the example, ToolSmith found that “The incident action was changed from the valid table path /api/now/table/incident to /api/now/table/incidents.” Its plan changed only that action’s path.
Then check the plan as you would for a build, including any steps tagged External action, which run when you approve. If the fix changes an asset that other plugins use, test those plugins too. In Tool Studio, the asset’s more actions menu (⋮) has Related assets, which lists them under Parent Assets.
Approve the fix
Select Approve plan, or Approve when the plan has no external actions. ToolSmith applies the fix and reports how many assets it modified, such as “Modified 1 asset”. To see which ones, select Assets in the Artifacts panel.
Test the plugin again
In the assistant, repeat the request that failed and check the answer.
If the plugin creates or updates records, also check them in the external system. The reply alone might not show whether a write happened, or happened twice.
If the problem remains
If the plugin still fails, tell ToolSmith in the same chat, with the request you repeated, the answer, and any new error message.
If ToolSmith cannot fix it, check the plugin’s logs and Common Errors, and edit the plugin in Tool Studio. To roll back a fix, see Undo a change.