Skip to main content

Metadata Tools

Version: 1.0
Last Updated: February 2025


Overview

Metadata tools expose the full Dynamics 365 schema to the AI agent. Before the agent can design logic that operates on a specific entity, it must understand that entity's structure—what attributes exist, what types they are, what option set values are available, and how the entity relates to others.

Metadata tools are always available, regardless of which FlowOn products are installed, because they read directly from the Dynamics 365 environment.

┌─────────────────────────────────────────────────────────────────────┐
│ WHY METADATA TOOLS MATTER │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ WITHOUT METADATA TOOLS │
│ ─────────────────────── │
│ AI generates logic using assumed attribute names │
│ → Logic fails at runtime because "totalamount" is │
│ actually "new_totalvalue" in this environment │
│ │
│ WITH METADATA TOOLS │
│ ──────────────────── │
│ AI calls metadata_get_entity_attributes("opportunity") │
│ → Discovers the exact attribute names, types, and │
│ requirements in this specific environment │
│ → Generates logic that is correct on the first attempt │
│ │
└─────────────────────────────────────────────────────────────────────┘

metadata_list_all_entities

Lists all Dynamics 365 entities in the environment.

ParameterTypeRequiredDescription
No parameters

Returns: A list of all entities including:

FieldDescription
logicalNameThe entity's logical name (used in all FlowOn and SDK references)
primaryIdAttributeThe primary key attribute name
primaryNameAttributeThe primary display name attribute
displayNameThe localised display name
displayCollectionNameThe localised plural display name
isActivityWhether this entity is a Dynamics 365 activity entity

Use when: You need to discover the correct logical name for an entity before designing logic that targets it. Never assume an entity's logical name — always verify.


metadata_list_all_global_optionsets

Lists all global option sets defined in the Dynamics 365 environment.

ParameterTypeRequiredDescription
No parameters

Returns: A list of global option sets with their logical name, display name, and type (picklist or boolean).

Use when: You need to find the name of a global option set before calling metadata_get_global_optionset_details to retrieve its values.


metadata_get_global_optionset_details

Retrieves the full definition of a specific global option set, including all its option values and labels.

ParameterTypeRequiredDescription
optionSetNamestringThe logical name of the global option set

Returns: The complete option set definition including every value-label pair.

Use when: You need the numeric integer values for a global picklist field to use in a Logic Block condition or formula. Option set conditions in FoL reference the integer value, not the label.


metadata_get_local_optionset_details

Retrieves the full definition of a local (entity-specific) option set—an option set that is defined on a specific entity attribute rather than shared globally.

ParameterTypeRequiredDescription
entityLogicalNamestringThe logical name of the entity
attributeLogicalNamestringThe logical name of the attribute whose option set to retrieve

Returns: The complete option set definition including every value-label pair for the specified attribute.

Use when: You need the integer values for a Status, State, or local Picklist attribute on a specific entity.


metadata_list_all_relationships

Lists all entity relationships in the Dynamics 365 environment.

ParameterTypeRequiredDescription
No parameters

Returns: All relationships per entity, broken down into three groups:

GroupDescription
oneToManyRelationshipsRelationships where this entity is the parent (1:N)
manyToOneRelationshipsRelationships where this entity is the child (N:1)
manyToManyRelationshipsIntersect relationships between two entities (N:N)

Use when: You need to understand how entities relate to each other before building logic that navigates related records, traverses lookups, or aggregates data across relationships.


metadata_get_entity_attributes

Retrieves the full attribute list for a specific Dynamics 365 entity, categorised by type.

ParameterTypeRequiredDescription
entityLogicalNamestringThe logical name of the entity

Returns: A structured breakdown of all attributes on the entity, grouped by type:

Attribute GroupAttribute Types Included
String AttributesString, Memo
Integer AttributesInteger, BigInt
Decimal AttributesDecimal
Double AttributesDouble
Money AttributesMoney
Boolean AttributesBoolean (Two Options)
DateTime AttributesDateTime — includes format (Date Only / Date and Time) and behaviour (User Local / Date Only / Time Zone Independent)
Picklist AttributesPicklist, MultiSelect Picklist, State, Status
Lookup AttributesLookup — includes the target entity logical name
Customer AttributesCustomer — polymorphic lookup (Account or Contact)
UniqueIdentifier AttributesUniqueidentifier
Image AttributesImage

Each attribute includes its logicalName and an isRequired flag indicating whether it is system-required or application-required.

Use when: This is typically the first tool an AI agent calls when asked to build logic for a specific entity. Understanding the available attributes, their types, and their requirement level is essential for generating correct FoL metadata.

┌─────────────────────────────────────────────────────────────────────┐
│ RECOMMENDED AGENT WORKFLOW FOR NEW LOGIC │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ 1. metadata_list_all_entities │
│ → Confirm the entity logical name │
│ │
│ 2. metadata_get_entity_attributes(entityLogicalName) │
│ → Understand all attributes, their types, and requirements │
│ │
│ 3. metadata_get_local_optionset_details (if needed) │
│ → Get integer values for picklist/status conditions │
│ │
│ 4. metadata_list_all_relationships (if needed) │
│ → Understand related entities before traversing lookups │
│ │
│ 5. Create the Logic Block or Logic Flow with accurate metadata │
│ │
└─────────────────────────────────────────────────────────────────────┘