Skip to content

Discovery and Listing Tools โ€‹

Unified search across all Gnosari entity types with optional text query and structured filters.

Annotations: readOnlyHint: true ยท destructiveHint: false ยท idempotentHint: true ยท openWorldHint: false

Parameters โ€‹

NameTypeRequiredDefaultDescription
querystringNo-Text search query. null returns all results using structured filters only
entitystringNo"agents"agents, traits, templates, knowledge, or all
access_levelstringNo-Filter agents by: PUBLIC, PRIVATE, PASSWORD_PROTECTED. Ignored for non-agent entities
domainstringNo-Filter agents by domain name (e.g. "joina.chat"). Ignored for non-agent entities
sort_bystringNo"updated_at"updated_at, created_at, or name
sort_orderstringNo"desc"asc or desc
limitintegerNo20Maximum results per entity type
skipintegerNo0Pagination offset

Returns โ€‹

  • Single entity (entity != "all") โ†’ SearchResult:

    • results: list[dict] โ€” matching entities
    • total: int โ€” total count
    • search_mode: str โ€” search backend used: "opensearch_hybrid" or "sql_fallback"
  • All entities (entity="all") โ†’ SearchAllResult:

    • agents: list[dict]
    • traits: list[dict]
    • templates: list[dict]
    • knowledge: list[dict]
    • total: int โ€” count across all types
    • search_mode: str โ€” search backend used: "opensearch_hybrid" or "sql_fallback"

The search_mode field indicates which backend produced the results. When OpenSearch is available and healthy, semantic hybrid search is used ("opensearch_hybrid"). When OpenSearch is unavailable or the query fails, the system transparently falls back to SQL ILIKE-based search ("sql_fallback").

Agent result dicts include a collection key with the lite shape {"record_count": int, "new_count": int}, or null if the agent has no collected records. last_capture is omitted at search time to keep response sizes small โ€” use gnosari_get when the full collection summary (including last_capture) is needed.

::warning Eventual consistency: Results may take 1-2 seconds to reflect recent mutations (creates, updates, deletes). The search index is updated asynchronously via the outbox worker. On first deploy, run reindex_entities.py to populate the OpenSearch index with existing data. ::

Examples โ€‹

Find agents by concept (semantic search):

python
results = gnosari_search(query="customer help desk", entity="agents")
print(f"Search mode: {results.search_mode}")
for agent in results.results:
    print(f"{agent['name']} (ID: {agent['id']}, {agent['access_level']})")
# Search mode: opensearch_hybrid
# Support Bot (ID: 123, PUBLIC)
# Enterprise Support (ID: 456, PRIVATE)

List all public agents:

python
results = gnosari_search(entity="agents", access_level="PUBLIC")
print(f"Public agents: {results.total}")

Search across everything:

python
results = gnosari_search(query="leads", entity="all")
print(f"Agents: {len(results.agents)}, Templates: {len(results.templates)}")
print(f"Search mode: {results.search_mode}")

Check search backend status:

python
results = gnosari_search(query="test", entity="agents")
if results.search_mode == "sql_fallback":
    print("OpenSearch unavailable -- using SQL fallback (exact match only)")

gnosari_check_uri โ€‹

Check whether a URI is available for publishing an agent.

Annotations: readOnlyHint: true ยท destructiveHint: false ยท idempotentHint: true ยท openWorldHint: false

Parameters โ€‹

NameTypeRequiredDescription
uristringYesURI slug to check (e.g. "my-agent")
domainstringNoDomain name to check on. Defaults to account's default domain

Returns โ€‹

UriCheckResult:

FieldTypeDescription
availableboolWhether the URI is free to use
current_gnosari_idintID of the agent using this URI (if taken)
current_gnosari_namestrName of the agent using this URI (if taken)
hintslist[str]Suggestions for alternatives if taken

Example โ€‹

python
check = gnosari_check_uri(uri="support-bot")
if check.available:
    gnosari_manage_access(gnosari_id=123, access_level="PUBLIC", uri="support-bot")
else:
    print(f"Taken by agent {check.current_gnosari_id}: {check.current_gnosari_name}")
    print(check.hints)
    # ["URI 'support-bot' is taken. Try variations like 'support-bot-2' or 'support-bot-bot'."]

Manage Tools โ€” List Action โ€‹

Each manage tool supports action="list" for read-only discovery:

gnosari_manage_traits(action="list") โ€‹

python
result = gnosari_manage_traits(action="list")
# Returns PaginatedTraitsResponse
for trait in result.data:
    print(f"{trait.name} (ID: {trait.id}, weight: {trait.weight}, is_default: {trait.is_default})")
# Empathetic (ID: 42, weight: 2.0, is_default: True)
# Professional (ID: 17, weight: 1.0, is_default: False)

# Filter by search
result = gnosari_manage_traits(action="list", search="professional")

# Check which traits are auto-assigned to new agents
defaults = [t for t in result.data if t.is_default]

Each TraitRead item in result.data includes is_default: bool โ€” True when the trait is automatically assigned to every interactively created new agent in the account.

gnosari_manage_knowledge(action="list") โ€‹

python
result = gnosari_manage_knowledge(action="list")
# Returns PaginatedKnowledgeSourcesResponse
for source in result.data:
    print(f"{source.name}: {source.status} ({source.document_count} docs)")

# Filter by loading status
result = gnosari_manage_knowledge(action="list", status="failed")

gnosari_manage_data_collection(action="list") โ€‹

python
result = gnosari_manage_data_collection(action="list")
# Returns PaginatedEntityTypesResponse
for template in result.data:
    print(f"{template.name} (system={template.is_template})")

# Exclude system templates
result = gnosari_manage_data_collection(action="list", include_system=False)

Tool Comparison โ€‹

ToolPurposereadOnlyAuth
gnosari_searchText search + filter across entitiesYesYes
gnosari_check_uriURI availability checkYesYes
gnosari_manage_traits(action="list")List traits โ€” each item includes is_default: boolYesYes
gnosari_manage_knowledge(action="list")List knowledge sourcesYesYes
gnosari_manage_data_collection(action="list")List data templatesYesYes
gnosari_collected_data(action="list")View collected recordsYesYes
gnosari_collected_data(action="stats")Collection statisticsYesYes
gnosari_healthServer statusYesNo

Next Steps โ€‹