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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| — | — | — | No parameters |
Returns: A list of all entities including:
| Field | Description |
|---|---|
logicalName | The entity's logical name (used in all FlowOn and SDK references) |
primaryIdAttribute | The primary key attribute name |
primaryNameAttribute | The primary display name attribute |
displayName | The localised display name |
displayCollectionName | The localised plural display name |
isActivity | Whether 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| — | — | — | 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
optionSetName | string | ✓ | The 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
entityLogicalName | string | ✓ | The logical name of the entity |
attributeLogicalName | string | ✓ | The 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| — | — | — | No parameters |
Returns: All relationships per entity, broken down into three groups:
| Group | Description |
|---|---|
oneToManyRelationships | Relationships where this entity is the parent (1:N) |
manyToOneRelationships | Relationships where this entity is the child (N:1) |
manyToManyRelationships | Intersect 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
entityLogicalName | string | ✓ | The logical name of the entity |
Returns: A structured breakdown of all attributes on the entity, grouped by type:
| Attribute Group | Attribute Types Included |
|---|---|
| String Attributes | String, Memo |
| Integer Attributes | Integer, BigInt |
| Decimal Attributes | Decimal |
| Double Attributes | Double |
| Money Attributes | Money |
| Boolean Attributes | Boolean (Two Options) |
| DateTime Attributes | DateTime — includes format (Date Only / Date and Time) and behaviour (User Local / Date Only / Time Zone Independent) |
| Picklist Attributes | Picklist, MultiSelect Picklist, State, Status |
| Lookup Attributes | Lookup — includes the target entity logical name |
| Customer Attributes | Customer — polymorphic lookup (Account or Contact) |
| UniqueIdentifier Attributes | Uniqueidentifier |
| Image Attributes | Image |
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 │
│ │
└─────────────────────────────────────────────────────────────────────┘