Skip to content

Feature request: modify the "No such tool available" response to list the tools that are available. #337

@KJ7LNW

Description

@KJ7LNW

Recently, while using a read-only /toolset that omits the Edit and Write tools, the model tried to Edit, got the error below, and responded as follows:

Ah, I'm in plan mode so Edit tool is not available. Let me use Write tool instead since I need to rewrite the whole file.

It then proceeded to attempt to use the Write tool to create a several hundred-line file (!) that also failed because writing was not available either. Needless to say, this is a waste of output context; output context is the most expensive and uses a lot of the session limit.

Now that /toolsets restrict which tools are available, it would be nice if errors like this respond with a list of tools that are available and tell it not to use the same tool again. It should indicate the tool set that is currently active in plan or code mode and explain that during this mode, only the following tools are active.

Suggested verbage change:

Error: No such tool available: Edit; only tools <Read, Glob, etc..> are available with current toolset <toolset_name> under the current <code|plan> mode.

Current behavior:

  'message' => {
    'content' => [
      {
        'content' => '<tool_use_error>Error: No such tool available: Edit</tool_use_error>',
        'is_error' => true,
        'type' => 'tool_result'
      }
    ],
    'role' => 'user'
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions