Microsoft Dynamics 365 MCP by usefulapi

v1.1.0
io.usefulapi/microsoft-dynamics-365 Checked 19 hours ago Published 7 days ago

Read tables and records, run FetchXML; create and update records in Microsoft Dynamics 365.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

dynamics365_whoami Who am I

Return the user id, business unit id and organization id that the app user acts as in this environment. Good first call to confirm the connection. Dataverse Web API: GET /api/data/v9.2/WhoAmI.

dynamics365_list_tables List tables

List Dataverse tables (entity definitions) with their logical name, entity set name and whether they are custom. Use the entity set name in the record tools. Dataverse Web API: GET /api/data/v9.2/EntityDefinitions.

ParameterTypeDescription
custom_onlybooleanReturn only custom tables (default false).
topintegerMaximum tables (1-1000, default 200).

dynamics365_get_table_columns Get table columns

List the columns (attributes) of one table: logical name, schema name, type, and whether it is the primary id or primary name. Dataverse Web API: GET /api/data/v9.2/EntityDefinitions(LogicalName='<table>')/Attributes.

ParameterTypeDescription
table *stringTable logical name, e.g. account, contact, opportunity.

dynamics365_list_records List records

List rows of one entity set with optional column selection, OData $filter, $orderby and $top. If the reply has @odata.nextLink, pass that value as next_link to get the next page (the other options are then ignored). Dataverse Web API: GET /api/data/v9.2/<entity_set>.

ParameterTypeDescription
entity_set *stringEntity set name, e.g. accounts, contacts, opportunities.
filterstringOData $filter, e.g. statecode eq 0 and revenue gt 1000000.
next_linkstringThe @odata.nextLink value of an earlier reply from this environment.
orderbystringOData $orderby, e.g. createdon desc.
selectstringComma-separated column names to return, e.g. name,revenue.
topintegerMaximum rows (1-500). Use @odata.nextLink in the reply to page.

dynamics365_get_record Get record

Return one record by id, with optional column selection. Dataverse Web API: GET /api/data/v9.2/<entity_set>(<id>).

ParameterTypeDescription
entity_set *stringEntity set name, e.g. accounts, contacts, opportunities.
id *stringRecord id (GUID).
selectstringComma-separated column names to return, e.g. name,revenue.

dynamics365_run_fetchxml Run FetchXML query

Run a FetchXML query for complex joins, aggregates and link-entities. The root <entity name> is the table logical name. Keep the query under about 4000 characters. Dataverse Web API: GET /api/data/v9.2/<entity_set>?fetchXml=...

ParameterTypeDescription
entity_set *stringEntity set name, e.g. accounts, contacts, opportunities.
fetch_xml *stringA complete <fetch> document.

dynamics365_create_record Create record

Create one record in an entity set and return the created row. Writes data in the customer's environment. Dataverse Web API: POST /api/data/v9.2/<entity_set> with Prefer: return=representation.

ParameterTypeDescription
entity_set *stringEntity set name, e.g. accounts, contacts, opportunities.
fields *objectColumn values by logical name, e.g. {"name": "Contoso"}. Lookups use "<field>@odata.bind": "/accounts(<guid>)".

dynamics365_update_record Update record

Update the given columns of one existing record. It never creates a record: the request sends If-Match: *, so an unknown id returns an error. Writes data in the customer's environment. Dataverse Web API: PATCH /api/data/v9.2/<entity_set>(<id>).

ParameterTypeDescription
entity_set *stringEntity set name, e.g. accounts, contacts, opportunities.
fields *objectColumn values by logical name, e.g. {"name": "Contoso"}. Lookups use "<field>@odata.bind": "/accounts(<guid>)".
id *stringRecord id (GUID).