Skip to content

Tools Forms

Ryan James edited this page Aug 17, 2026 · 3 revisions

Forms tools

This page is generated from the code by scripts/gen_wiki_tools.py — do not edit by hand.

6 tools · category token forms · enable with DATAVERSE_TOOLS=forms (unset enables every category)

Tool-Index · Home

Write tools additionally require DATAVERSE_ALLOW_WRITE=true; delete tools require DATAVERSE_ALLOW_DELETE=true.


dataverse_add_form_control

Write · non-idempotent · category forms

Add a column control to a Dataverse model-driven app form.

Resolves the correct control classid from column metadata automatically — supply only the column logical name. Memo and TextArea columns auto-get rowspan=3 for usable height; override with rowspan if needed. Publishes automatically — no separate publish needed. Use dataverse_get_form first to see the current layout and section indices. Requires DATAVERSE_ALLOW_WRITE=true.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
form_id str yes GUID of the form to update. (min_len=36, max_len=36)
table_logical_name str yes Logical name of the table the form belongs to (e.g., 'cr123_myentity'). Used to look up column metadata to determine the correct control type. (min_len=1, pattern=^[a-zA-Z_][a-zA-Z0-9_]*$)
datafieldname str yes Logical name of the column to add (e.g., 'cr123_description'). (min_len=1)
label str | None no None Display label for the control. Defaults to the column's display name if omitted.
section_index int no 0 Zero-based index of the section (within the first tab) to add the control to. Use dataverse_get_form to see the current section layout. Defaults to 0. (ge=0)
row_index int | None no None Zero-based position within the section to insert the control. Omit to append at the end of the section. (ge=0)
rowspan int | None no None Number of rows the cell spans vertically (maps to 'rowspan' on <cell> per the FormXml XSD). Omit to use the automatic default: Memo and TextArea columns default to 3 for usable height; all other types default to 1 (no rowspan set). (ge=1)
disabled bool no False When True, renders the control as read-only on the form. Maps to the 'disabled' boolean attribute on <control> in the FormXml XSD.
isrequired bool no False When True, shows the required indicator on the form control. Maps to 'isrequired' on <control> in the FormXml XSD. Distinct from the column's RequiredLevel metadata.
solution_unique_name str | None no None If provided, adds the form to this solution after the update via AddSolutionComponent (component type 60 — System Form). (pattern=^[a-zA-Z_][a-zA-Z0-9_]*$)

Returns {"added": ..., "form_id": ..., "datafieldname": ..., "label": ..., "classid": ..., "attribute_type": ..., "rowspan": ..., "disabled": ..., "isrequired": ..., "section_index": ..., "row_index": ..., "published": ..., "solution_unique_name": ..., "formxml_backup": ...}. Errors return {"error": true, "message": "..."}.


dataverse_get_form

Read · idempotent · category forms

Get a single Dataverse form's layout parsed as a structured JSON object.

Parses raw FormXml into a readable tabs → sections → controls tree so agents don't need to work with raw XML. Also returns formxml_backup (the raw XML string). Use dataverse_list_forms to discover form IDs.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
form_id str yes GUID of the form to retrieve (e.g., 'd0e900e1-ddbf-434b-868a-fa48d45ea15f'). (min_len=36, max_len=36)

Returns {"form_id": ..., "name": ..., "table": ..., "type": ..., "type_name": ..., "is_default": ..., "activation_state": ..., "layout": ..., "formxml_backup": ...}. Errors return {"error": true, "message": "..."}.


dataverse_list_forms

Read · idempotent · category forms

List model-driven app forms registered in the Dataverse environment.

Returns form metadata: id, name, type, activation state, and default flag. Filter by table_logical_name and/or form_type (2=Main, 4=Quick View, 5=Quick Create, 9=Card). Use dataverse_get_form to inspect a form's layout.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
table_logical_name str | None no None Logical name of the table to filter forms by (e.g., 'account'). Omit to return forms for all tables. (pattern=^[a-zA-Z_][a-zA-Z0-9_]*$)
form_type int | None no None Filter by form type integer. Common values: 2 = Main, 4 = Quick View, 5 = Quick Create, 9 = Card. Omit to return all types.
top int no 50 Maximum number of records to return. (ge=1, le=5000)

Returns {"forms": ..., "count": ..., "has_more": ...}. Errors return {"error": true, "message": "..."}.


dataverse_remove_form_control

Write · idempotent · category forms

Remove a column control from a Dataverse model-driven app form.

Finds the control by datafieldname and removes the entire row it occupies. Returns an error if the control is not found — no change is made. Publishes automatically — no separate publish needed. The original FormXml is returned in formxml_backup for rollback. Requires DATAVERSE_ALLOW_WRITE=true.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
form_id str yes GUID of the form to update. (min_len=36, max_len=36)
datafieldname str yes Logical name of the column whose control should be removed. (min_len=1)
solution_unique_name str | None no None If provided, adds the form to this solution after the update via AddSolutionComponent (component type 60 — System Form). (pattern=^[a-zA-Z_][a-zA-Z0-9_]*$)

Returns {"removed": ..., "form_id": ..., "datafieldname": ..., "published": ..., "solution_unique_name": ..., "formxml_backup": ...}. Errors return {"error": true, "message": "..."}.


dataverse_set_formxml

Write · idempotent · category forms

Replace a Dataverse form's FormXml with a complete new XML string, then publish.

Use for full form redesigns — adding/removing tabs and sections, reordering controls across sections, setting column widths. For targeted edits prefer dataverse_add_form_control / dataverse_remove_form_control. Validates the XML before writing — returns errors without patching if invalid. Use dataverse_validate_formxml as a dry-run first. Publishes automatically — no separate publish needed. Returns formxml_backup for rollback. Requires DATAVERSE_ALLOW_WRITE=true.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
form_id str yes GUID of the form to update. (min_len=36, max_len=36)
formxml str yes Complete replacement FormXml string. Must be well-formed XML with a <form> root. Use dataverse_get_form to retrieve the current FormXml as a starting point, and dataverse_validate_formxml with this string as a dry-run before committing. (min_len=1)
solution_unique_name str | None no None If provided, adds the form to this solution after the update via AddSolutionComponent (component type 60 — System Form). (pattern=^[a-zA-Z_][a-zA-Z0-9_]*$)

Returns {"updated": ..., "published": ..., "form_id": ..., "table": ..., "solution_unique_name": ..., "formxml_backup": ...}. Errors return {"error": true, "message": "..."}.


dataverse_validate_formxml

Read · idempotent · category forms

Validate FormXml against structural rules derived from the FormXml XSD.

Two modes: pass formxml to validate a string directly (dry-run before dataverse_set_formxml), or omit formxml to fetch and validate the live form. Returns valid=true + control list, or valid=false + full error list. All write tools run this validation automatically before every PATCH.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
form_id str yes GUID of the form to validate (e.g., 'd0e900e1-ddbf-434b-868a-fa48d45ea15f'). (min_len=36, max_len=36)
formxml str | None no None FormXml string to validate directly. When provided, validates this XML without fetching from Dataverse — use as a dry-run before calling dataverse_set_formxml. When omitted, fetches and validates the live form's current FormXml. (min_len=1)

Returns JSON. Errors return {"error": true, "message": "..."}.


Clone this wiki locally