{%- set enabled_toolsets_with_instructions = [] -%}
{%- set disabled_toolsets = [] -%}

{%- for toolset in toolsets -%}
  {%- if toolset.llm_instructions and toolset.status.value == "enabled" -%}
    {%- set _ = enabled_toolsets_with_instructions.append(toolset) -%}
  {%- elif toolset.status.value != "enabled" -%}
    {%- set _ = disabled_toolsets.append(toolset) -%}
  {%- endif -%}
{%- endfor -%}

{% if enabled_toolsets_with_instructions|list -%}
# Available Toolsets
{%- for toolset in enabled_toolsets_with_instructions -%}
{% if toolset.llm_instructions %}

## {{ toolset.name }}
{{ toolset.llm_instructions }}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{% if disabled_toolsets %}
# Disabled & failed Toolsets

The following toolsets are either disabled or failed to initialize:
{% for toolset in disabled_toolsets %}
* toolset "{{ toolset.name }}": {{ toolset.description }}
    {%- if toolset.status == "failed" %}
    *  status: The toolset is enabled but misconfigured and failed to initialize.
      {%- if toolset.error %}
    *  error: {{ toolset.error }}
      {%- endif -%}
    {%- else %}
    *  status: {{ toolset.status.value }}
    {%- endif %}
    {%- if toolset.docs_url %}
    *  setup instructions: {{ toolset.docs_url }}
    {%- endif -%}
{%- endfor %}

If you need a toolset to access a system that you don't otherwise have access to:
  - Check the list of toolsets above and see if any loosely match the needs
  - If the toolset has `status: failed`: Tell the user and copy the error in your response for the user to see
  - If the toolset has `status: disabled`: Ask the user to configure the it.
    - Share the setup instructions URL with the user
    - Invoke the tool fetch_webpage on the toolset URL and summarize setup steps
  - If there are no relevant toolsets in the list below, tell the user that you are missing an integration to access XYZ:
    you should give an answer similar to "I don't have access to <system>. Please add a Holmes integration for <system> so
    that I can investigate this."
{% else %}

# Disabled & failed Toolsets

If you need a toolset to access a system that you don't otherwise have access to, tell the user that you are missing an integration to access XYZ.
You should give an answer similar to "I don't have access to <system>. Please add a Holmes integration for <system> so that I can investigate this."
{%- endif -%}
