{% extends layout %} {% import "macros.html" as m %} {% block content %}

{{ tool }}

{% if error %}

{{ error }}

{% else %}

{{ call.status }} {{ call.bytes }} bytes, {{ call.ms }} ms, release {{ call.release }} {% if call.hits is defined %}, {{ call.hits }} hit(s){% endif %} {% if call.gap %}, gap {{ call.gap }}{% endif %}

{% set body = call.payload %} {% if tool == 'get_coverage' and not is_error %} {% if body.topics is defined %}

{{ body.scope_statement }}

jurisdictions: {{ body.jurisdictions | join(', ') }} - languages: {{ body.languages | join(', ') }} - snapshot {{ body.freshness.snapshot_date }}, stale from {{ body.freshness.stale_from }}

{% for topic in body.topics %} {% endfor %}
TopicConceptsJurisdictions
{{ topic.title }} {{ topic.topic_id }} {{ topic.concept_count }} {{ topic.jurisdictions | join(', ') }}

Out of scope

{% else %}

{{ body.title }}

{% for concept in body.concepts %} {% endfor %}
ConceptAliasesRequired contextJurisdictions
{{ m.concept_link(pack.pack, concept.concept_id) }}
{{ concept.label }}
{{ concept.aliases | join(', ') or '-' }} {{ concept.required_context | join(', ') or '-' }} {{ concept.jurisdictions | join(', ') }}
{% endif %} {% elif tool == 'search' and not is_error %} {% for hit in body.results %} {% else %}{% endfor %}
ConceptScoreMatched onRequired context
{{ m.concept_link(pack.pack, hit.concept_id) }}
{{ hit.label }}
{{ hit.score }}{{ hit.matched_on | join(', ') }} {{ hit.required_context | join(', ') or '-' }}
No hit.
{% elif tool == 'resolve' and not is_error %}

status {{ body.status }}, as_of {{ body.as_of }}, scope {{ body.executed_scope }}{% if body.status == 'STALE' %} - snapshot {{ body.freshness.snapshot_date }}, stale from {{ body.freshness.stale_from }}{% endif %}

{% for item in body.results %}

{{ m.concept_link(pack.pack, item.concept_id) }} {{ item.status }} {% if item.answering_jurisdiction %}answering as {{ item.answering_jurisdiction }}{% endif %}

{% for gap in item.gaps %}

{{ gap.dimension }}: {{ gap.message }}
published values: {{ gap.published_values | join(', ') }}

{% endfor %} {% for missing in item.missing_context %}

needs {{ missing.field }}: {{ missing.hint }}
options: {{ (missing.options or []) | join(', ') }}

{% endfor %} {% for fact in item.facts %}
{{ fact.fact_id }}
{{ fact.statement }}
{{ fact.jurisdiction }} - {{ fact.condition or 'no condition' }} - valid {{ fact.valid_from or 'unbounded' }} to {{ fact.valid_through or 'unbounded' }} - evidence {{ fact.evidence_ids | join(', ') }}
{% endfor %} {% if item.citations %} {% for citation in item.citations %} {% endfor %}
EvidencePublisherURLAccessed
{{ citation.evidence_id }}{{ citation.publisher }} {{ citation.url | shorten(60) }} {{ citation.accessed_on }}
{% endif %}
{% endfor %} {% elif tool == 'get_evidence' and not is_error %} {% for item in body.evidence %}

{{ item.evidence_id }} - {{ item.publisher }} - {{ item.language }} - accessed {{ item.accessed_on }}
{{ item.url }}

{{ item.original_excerpt }}
{% endfor %} {% endif %}
the JSON the caller receives ({{ call.bytes }} bytes)
{{ call.text }}
{% if not read_only and tool in ('resolve', 'search') and not is_error %}
Save this call as a check
{% if tool == 'resolve' %} {% else %} {% endif %}
{% endif %} {% endif %} {% endblock %}