AI tools

get_artifact

Last updated on

Retrieve one artifact and its instructions from a Paradoc registry

Retrieves one artifact from a registry. The tool reads registry.json, checks the artifact is listed, and fetches it. By default it also returns the artifact's instructions and agentInstructions.

Input

FieldTypeRequiredDescription
registry_urlstring (URL)NoRegistry base URL. Falls back to defaultRegistryUrl in the config.
artifact_namestringYesArtifact name within the registry
include_instructionsbooleanNoReturn the artifact's instructions. Default true.
include_agent_instructionsbooleanNoReturn the artifact's agentInstructions. Default true.

Output

FieldTypeDescription
artifactobjectThe artifact JSON (form, document, bundle, or checklist)
artifact_namestringThe requested name
base_urlstringThe artifact's directory. Pass it as base_url in an artifact source so file-backed layers resolve.
instructionsInstructionContentThe artifact's instructions, when present and requested
agent_instructionsInstructionContentThe artifact's agent instructions, when present and requested
errorToolErrorSet when the artifact could not be fetched, for example artifact_not_found

InstructionContent has these fields:

FieldTypeDescription
kind"inline" | "file"Inline text or a file next to the artifact
mime_typestringFile MIME type (file only)
pathstringFile path relative to the artifact (file only)
contentstringThe instruction content
encoding"utf-8" | "base64"utf-8 for text, base64 for binary files

Direct usage

import { executeGetArtifact } from "@paradoc/ai-tools"

const result = await executeGetArtifact({
  registry_url: "https://public.paradoc.dev",
  artifact_name: "pet-addendum",
})

Example response

The artifact is shortened here. The real registry response also includes file-backed instructions and agent_instructions entries.

{
  "artifact": {
    "kind": "form",
    "name": "pet-addendum",
    "version": "1.0.0",
    "title": "Pet Addendum to Lease Agreement",
    "fields": { "petName": { "type": "text", "label": "Pet name", "required": true } }
  },
  "artifact_name": "pet-addendum",
  "base_url": "https://public.paradoc.dev/pet-addendum"
}

On this page