AI tools

get_registry

Last updated on

Discover the artifacts available in an Asterdoc registry

Fetches a registry's registry.json and returns the artifacts it lists, with the editions and versions of each.

Input

FieldTypeRequiredDescription
registry_urlstring (URL)NoRegistry base URL. Falls back to defaultRegistryUrl in the config.

If neither is set, the tool returns a missing_registry_url error.

Output

FieldTypeDescription
registry_urlstringThe registry that was read
namestringThe registry's name
descriptionstringThe registry's description, when it has one
itemsRegistryItem[]The listed artifacts. Empty when the call fails.
errorToolErrorSet when the registry could not be read

RegistryItem has these fields:

FieldTypeDescription
namestringArtifact name. Pass it as artifact_name.
kindstringform, document, checklist, or bundle
title, description, tagsPresent when the registry states them
current_editionstringKey of the edition used when a request names none. Only on an artifact that has editions.
editionsobject[]Every edition, the current one first: key, label, date?, effective_from?, latest_version, and versions
latest_versionstringThe version used when a request names none. Only on an artifact that has no editions.
versionsstring[]Every version, the latest first. Only on an artifact that has no editions.

An edition is the issuer's revision of a form, such as IRS W-9 Rev. March 2024. A version is the registry publisher's own revision of the artifact for that edition. The publisher states which edition is current and which version is latest. See Editions and versions.

Direct usage

import { executeGetRegistry } from "@asterdoc/ai-tools"

const result = await executeGetRegistry({
  registry_url: "https://registry.acme.com",
})

With a configured default, the input can be empty:

const result = await executeGetRegistry({}, {
  defaultRegistryUrl: "https://registry.acme.com",
})

Example response

The response is shortened here.

{
  "registry_url": "https://registry.acme.com",
  "items": [
    {
      "name": "pet-addendum",
      "kind": "form",
      "title": "Pet Addendum to Lease Agreement",
      "latest_version": "1.0.0",
      "versions": ["1.0.0"]
    }
  ]
}

On this page