{% if data is defined %}
{% for tool in data %}
{% set can_modify = is_admin or tool.ownerEmail == current_user_email or (tool.visibility == 'team' and tool.teamId and user_team_roles.get(tool.teamId|string) == 'owner') %}
{% set clean_desc = (tool.description or "") | decode_html | replace('\n', ' ') | replace('\r', ' ') %}
{% set refactor_desc = clean_desc | striptags | trim %}
{% if refactor_desc | length is greaterthan 220 %}
{{ refactor_desc[:400] + "..." }}
{% else %}
{{ refactor_desc }}
{% endif %}
{% if tool.annotations %}
{% if tool.annotations.readOnlyHint %}
📖
{% endif %}
{% if tool.annotations.destructiveHint %}
⚠️
{% endif %}
{% if tool.annotations.idempotentHint %}
🔄
{% endif %}
{% if tool.annotations.openWorldHint %}
🌐
{% endif %}
{% else %}
None
{% endif %}
{% if tool.tags %}
{% for tag in tool.tags %}
{% if tag is mapping %}{{ tag.id }}{% else %}{{ tag }}{% endif %}
{% endfor %}
{% else %}
None
{% endif %}
{{ tool.ownerEmail }}
{% if tool.teamName %}{{ tool.teamName }}{% else %}None{% endif %}
{% if tool.visibility == "public" %}
🌍 Public
{% elif tool.visibility == "team" %}
👥 Team
{% else %}
🔒 Private
{% endif %}
{% set enabled = tool.enabled %}
{% set reachable = tool.reachable %}
{% if enabled and reachable %}
Online
{% elif enabled %}
Offline
{% else %}
Inactive
{% endif %}
{% if not enabled %} 💡Tool is Manually Deactivated. {%
elif not reachable %} 💡The host gateway for this tool
is unreachable. {% else %} 💡Everything stable. {% endif
%}
{% if can_modify %}
{% endif %}
{% if can_modify %}
{% if tool.enabled %}
{% else %}
{% endif %}
{% endif %}
{% endfor %}
{% set base_url = root_path + '/admin/tools/partial' %}
{% set hx_target = '#tools-table-body' %}
{% set hx_indicator = '#tools-loading' %}
{% set table_name = 'tools' %}
{% set query_params = {'include_inactive': include_inactive} %}
{% include 'pagination_controls.html' %}
{% else %}
{% for tool in tools %}
{% set can_modify = is_admin or tool.ownerEmail == current_user_email or (tool.visibility == 'team' and tool.teamId and user_team_roles.get(tool.teamId|string) == 'owner') %}
{% set clean_desc = (tool.description or "") | decode_html | replace('\n', ' ') | replace('\r', ' ') %}
{% set refactor_desc = clean_desc | striptags | trim %}
{% if refactor_desc | length is greaterthan 220 %}
{{ refactor_desc[:400] + "..." }}
{% else %}
{{ refactor_desc }}
{% endif %}
{% if tool.annotations %}
{% if tool.annotations.readOnlyHint %}
📖
{% endif %}
{% if tool.annotations.destructiveHint %}
⚠️
{% endif %}
{% if tool.annotations.idempotentHint %}
🔄
{% endif %}
{% if tool.annotations.openWorldHint %}
🌐
{% endif %}
{% else %}
None
{% endif %}
{% if tool.tags %}
{% for tag in tool.tags %}
{% if tag is mapping %}{{ tag.id }}{% else %}{{ tag }}{% endif %}
{% endfor %}
{% else %}
None
{% endif %}
{{ tool.ownerEmail }}
{% if tool.teamName %}{{ tool.teamName }}{% else %}None{% endif %}
{% if tool.visibility == "public" %}
🌍 Public
{% elif tool.visibility == "team" %}
👥 Team
{% else %}
🔒 Private
{% endif %}
{% set enabled = tool.enabled %}
{% set reachable = tool.reachable %}
{% if enabled and reachable %}
Online
{% elif enabled %}
Offline
{% else %}
Inactive
{% endif %}
{% if not enabled %} 💡Tool is Manually Deactivated. {%
elif not reachable %} 💡The host gateway for this tool
is unreachable. {% else %} 💡Everything stable. {% endif
%}
{% if can_modify %}
{% endif %}
{% if can_modify %}