-
Notifications
You must be signed in to change notification settings - Fork 16
mcp_manage_view
PhuocLe edited this page Jun 20, 2026
·
3 revisions
| Field | Value |
|---|---|
| Tool name | manage_view |
| MCP title | Manage entity views |
| Category | standard |
| Implementation | DynamicsCrm.DevKit.Cli/Mcp/Tools/ManageViewTool.cs |
| Estimated token count | ~734 tokens (tools/list tool JSON, o200k_base, measured 2026-06-18) |
| Last verified | 2026-06-18 |
Dataverse views (savedquery/userquery) — list/detail/create/update/rename/set_default/undo. Required: list (none); detail (view_id OR view_name); create (view_name+layoutxml); update (view_id OR view_name + layoutxml and/or cell_updates_json); rename (view_id+view_name); set_default (view_id OR view_name); undo (view_id+backup path). Auto: backup→XSD+sync validate→update→publish. SYNC RULE: every FetchXML <attribute> MUST have a matching LayoutXML <cell>; mismatch blocks. querytype: 0=Public, 4=QuickFind, 64=SubGrid. See docs://instructions_for_views, schema://layoutxml, schema://fetchxml.
QUICK FIND NOTE: for query_type=4, searchable fields are FetchXML <condition> nodes inside <filter isquickfindfields="1">. LayoutXML <cell> only controls displayed columns and does NOT make a field searchable.
WHEN TO USE:
- Inspect existing views (list, detail) before editing
- Apply layout/fetch changes (action=update)
- Patch cell attributes only via cell_updates_json (no full LayoutXML rebuild)
NAME RESOLUTION: entity_name, FetchXML field/entity references, LayoutXML cell names, and cell_updates_json cell_name values accept Display Name or logical/schema name. Display Name contains is resolved first, then logical/schema contains.
FUZZY/AMBIGUITY:
- view_name is contains match. Exactly 1 → auto-detail; multiple → tool returns candidates, use view_id to disambiguate.
SAFETY:
- Validation blocks FetchXML/LayoutXML mismatch by default (validate=true).
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
action |
string |
Yes | - |
'list', 'detail', 'create', 'update', 'rename', 'set_default', 'undo'. |
entity_name |
string |
Yes | - |
Entity Display Name or logical name (Display Name is resolved first; e.g. 'Account' or 'account'). |
view_id |
string |
No | "" |
GUID. Required: detail/update/rename/undo. |
view_name |
string |
No | "" |
Name contains. 1 match → auto-detail. |
query_type |
integer |
No | -1 |
0=Public, 1=Lookup, 4=QuickFind, 64=SubGrid. -1=all. |
include_fetchxml |
boolean |
No | false |
List only. Detail always includes XMLs. |
include_personal |
boolean |
No | false |
Include userquery (personal views). |
layoutxml |
string |
No | "" |
update/create: LayoutXML. undo: backup path. |
fetchxml |
string |
No | "" |
Empty = keep (update) / auto-generate (create). undo: backup path. |
validate |
boolean |
No | true |
XSD + sync check before write. |
backup |
boolean |
No | true |
Backup before overwrite. |
cell_updates_json |
string |
No | "" |
JSON array of {cell_name, set_attributes, remove_attributes}. Patch cell attrs (imageproviderwebresource, imageproviderfunctionname, ishidden, …) without rebuilding LayoutXML. |
{
"type": "object",
"properties": {
"action": {
"type": "string",
"description": "'list', 'detail', 'create', 'update', 'rename', 'set_default', 'undo'."
},
"entity_name": {
"type": "string",
"description": "Entity Display Name or logical name (Display Name is resolved first; e.g. 'Account' or 'account')."
},
"view_id": {
"type": "string",
"description": "GUID. Required: detail/update/rename/undo.",
"default": ""
},
"view_name": {
"type": "string",
"description": "Name contains. 1 match → auto-detail.",
"default": ""
},
"query_type": {
"type": "integer",
"description": "0=Public, 1=Lookup, 4=QuickFind, 64=SubGrid. -1=all.",
"default": -1
},
"include_fetchxml": {
"type": "boolean",
"description": "List only. Detail always includes XMLs.",
"default": false
},
"include_personal": {
"type": "boolean",
"description": "Include userquery (personal views).",
"default": false
},
"layoutxml": {
"type": "string",
"description": "update/create: LayoutXML. undo: backup path.",
"default": ""
},
"fetchxml": {
"type": "string",
"description": "Empty = keep (update) / auto-generate (create). undo: backup path.",
"default": ""
},
"validate": {
"type": "boolean",
"description": "XSD + sync check before write.",
"default": true
},
"backup": {
"type": "boolean",
"description": "Backup before overwrite.",
"default": true
},
"cell_updates_json": {
"type": "string",
"description": "JSON array of {cell_name, set_attributes, remove_attributes}. Patch cell attrs (imageproviderwebresource, imageproviderfunctionname, ishidden, …) without rebuilding LayoutXML.",
"default": ""
}
},
"required": [
"action",
"entity_name"
]
}| Resource | URI / URI template | MIME type | Reason |
|---|---|---|---|
fetchxml_schema |
schema://fetchxml |
application/xml |
Mentioned in MCP metadata: Returns the XML schema defining the FetchXML query language. Structure: fetch > entity > attribute, filter, link-entity, order. Note: The execute_fetchxml tool description already provides a curated guide. This schema is for advanced/edge cases. |
layoutxml_instructions |
docs://instructions_for_views |
text/markdown |
Mentioned in MCP metadata: Rules and best practices for modifying Dataverse view definitions. Read this before creating or modifying views via manage_view. |
layoutxml_schema |
schema://layoutxml |
application/xml |
Mentioned in MCP metadata: Returns the XML schema defining the column layout of Dataverse views. Structure: grid > row > cell (with name and width attributes). Read this schema before creating or modifying view column layouts. |
- Inspect existing views (list, detail) before editing
- Apply layout/fetch changes (action=update)
- Patch cell attributes only via cell_updates_json (no full LayoutXML rebuild)
- SAFETY: Validation blocks FetchXML/LayoutXML mismatch by default (validate=true).
- FUZZY/AMBIGUITY: view_name is contains match. Exactly 1 → auto-detail; multiple → tool returns candidates, use view_id to disambiguate.
- NAME RESOLUTION: entity_name, FetchXML field/entity references, LayoutXML cell names, and cell_updates_json cell_name values accept Display Name or logical/schema name. Display Name contains is resolved first, then logical/schema contains.
- QUICK FIND NOTE: for query_type=4, searchable fields are FetchXML nodes inside . LayoutXML only controls displayed columns and does NOT make a field searchable.
{
"action": "string",
"entity_name": "string"
}Returns CallToolResult from the MCP server. The response content and structured fields follow the tool implementation and model returned by ManageViewTool.manage_view.
- "List public Account views and include their FetchXML."
- "Update this view layout to add these columns and validate FetchXML/LayoutXML sync."
- "Set this Contact view as the default public view."