AI Deep Dive

Dynamic Tooling with Metadata

Use metadata-driven tools to let the assistant discover fields, validate payloads, and execute write actions without hardcoding each entity.

Architecture pattern

The recommended integration is schema-aware and tool-driven:

  • Expose metadata as a discovery tool.
  • Expose write operations as controlled tools.
  • Let the model call tools in sequence: inspect schema, ask for missing fields, submit validated payload.

Why dynamic tools matter

  • New fields in Snello metadata become available to AI flows without backend code rewrites.
  • The assistant reduces hallucinations by relying on real schema definitions.
  • Validation can happen before write calls by matching payload keys against metadata fields.

Suggested tool contract

getSchema(entityName)
upsertContent(entityName, jsonData)
listContent(entityName, filters)

Keep tools narrowly scoped and explicit in responsibility so you can audit usage and errors.

Operational flow

  1. User asks to create or update content.
  2. Assistant calls getSchema for the target entity.
  3. Assistant requests missing required values from user.
  4. Assistant sends a final structured payload through upsertContent.

System prompt guidance

Instruct the assistant to always query schema before writes and to reject unknown fields. This significantly improves consistency and safety.